0

我正在使用 React,刚刚添加了这个模块,ccxt。在添加模块之前一切都很好。模块安装正常。后来,我将此行添加到脚本中:

const ccxt = require ('ccxt');

然后当我发出npm start它会引发错误:

[WARN] No ENV file found
[OKAY] Wrapping display Output to 78 Columns
16:29:02 backend.1  |  info: Starting app...
16:29:03 frontend.1 |  events.js:167
16:29:03 frontend.1 |        throw er; // Unhandled 'error' event
16:29:03 frontend.1 |        ^
16:29:03 frontend.1 |  Error: listen EADDRINUSE 127.0.0.1:8080
16:29:03 frontend.1 |      at Server.setupListenHandle [as _listen2] (net.js:1330:14)
16:29:03 frontend.1 |      at listenInCluster (net.js:1378:12)
16:29:03 frontend.1 |      at GetAddrInfoReqWrap.doListen [as callback] (net.js:1491:7)
16:29:03 frontend.1 |      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:55:10)
16:29:03 frontend.1 |  Emitted 'error' event at:
16:29:03 frontend.1 |      at emitErrorNT (net.js:1357:8)
16:29:03 frontend.1 |      at process._tickCallback (internal/process/next_tick.js:63:19)
[DONE] Killing all processes with signal  null
internal/util.js:232
  throw new ERR_UNKNOWN_SIGNAL(signal);
  ^

TypeError [ERR_UNKNOWN_SIGNAL]: Unknown signal: null
    at convertToValidSignal (internal/util.js:232:9)
    at ChildProcess.kill (internal/child_process.js:411:5)
    at EventEmitter.<anonymous> (/home/marcus/development/nodestuff/crypto-crawler/node_modules/foreman/lib/proc.js:49:11)
    at EventEmitter.emit (events.js:187:15)
    at ChildProcess.<anonymous> (/home/marcus/development/nodestuff/crypto-crawler/node_modules/foreman/lib/proc.js:45:13)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:235:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sails-react-webpack@0.2.0 start: `nf start --wrap`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sails-react-webpack@0.2.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/marcus/.npm/_logs/2018-06-03T21_29_03_091Z-debug.log

我尝试“npm install”并得到一个错误(即使 npm install --save ccxt 运行良好):

clean-webpack-plugin: /home/marcus/development/nodestuff/crypto-crawler/public/dist has been removed.
ModuleParseError: Module parse failed: /home/marcus/development/nodestuff/crypto-crawler/node_modules/ccxt/js/allcoin.js Unexpected token (60:10)
You may need an appropriate loader to handle this file type.

有什么建议告诉我什么或者你可以如何解决这个问题?

4

1 回答 1

1

该错误Error: listen EADDRINUSE 127.0.0.1:8080似乎表明您正在尝试在端口 8080 上运行两个进程。

这里没有关于您的开发环境/应用程序架构的足够信息来具体告诉您该做什么,但听起来您需要配置您的应用程序服务器或 cctx 以使用不同的端口。我的猜测是cctx默认使用8080端口。

尝试8080在您的应用程序代码库中搜索并将其更改为其他内容。要么,要么在 cctx 文档中查找配置选项,以指定要在其上运行的端口。

此外,运行lsof -i | grep 8080以查看您的计算机上是否有任何其他进程正在使用端口 8080。

希望这有帮助,祝你好运!

于 2018-06-03T22:07:01.910 回答