gpt4 book ai didi

javascript - 如何解决 webpack“Mod

转载 作者:行者123 更新时间:2023-12-03 01:45:11 27 4
gpt4 key购买 nike

我正在使用 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.

这告诉我什么或者您如何解决这个问题有什么建议吗?

最佳答案

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

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

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

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

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

关于javascript - 如何解决 webpack“Mod,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50671281/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com