【问题标题】:react-redux-starter-kit npm run dev crashesreact-redux-starter-kit npm run dev 崩溃
【发布时间】:2016-09-09 04:26:02
【问题描述】:

我是 React/Redux 的新手,我正在使用 react-redux-starter-kit 样板来深入研究它。 npm run dev 工作正常,但现在由于此错误而崩溃:

express-react-redux-starter@1.0.0 dev /Users/unomas/Documents/web/suited-template webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 127.0.0.1:3000
    at Object.exports._errnoException (util.js:907:11)
    at exports._exceptionWithHostPort (util.js:930:20)
    at Server._listen2 (net.js:1250:14)
    at listen (net.js:1286:10)
    at net.js:1395:9
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:64:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:83:10)

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! express-react-redux-starter@1.0.0 dev: `webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the express-react-redux-starter@1.0.0 dev script 'webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors'.
npm ERR! This is most likely a problem with the express-react-redux-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs express-react-redux-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls express-react-redux-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/unomas/Documents/web/suited-template/npm-debug.log

npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
2 info using npm@2.15.9
3 info using node@v4.5.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info predev express-react-redux-starter@1.0.0
6 info dev express-react-redux-starter@1.0.0
7 verbose unsafe-perm in lifecycle true
8 info express-react-redux-starter@1.0.0 Failed to exec dev script
9 verbose stack Error: express-react-redux-starter@1.0.0 dev: `webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at EventEmitter.emit (events.js:172:7)
9 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at ChildProcess.emit (events.js:172:7)
9 verbose stack     at maybeClose (internal/child_process.js:829:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid express-react-redux-starter@1.0.0
11 verbose cwd /Users/unomas/Documents/web/suited-template
12 error Darwin 14.5.0
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
14 error node v4.5.0
15 error npm  v2.15.9
16 error code ELIFECYCLE
17 error express-react-redux-starter@1.0.0 dev: `webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors`
17 error Exit status 1
18 error Failed at the express-react-redux-starter@1.0.0 dev script 'webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors'.
18 error This is most likely a problem with the express-react-redux-starter package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors
18 error You can get information on how to open an issue for this project with:
18 error     npm bugs express-react-redux-starter
18 error Or if that isn't available, you can get their info via:
18 error
18 error     npm owner ls express-react-redux-starter
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

不确定是否有人熟悉此样板或错误。请让我知道任何解决方法。谢谢

【问题讨论】:

  • 您是否更改了 webpack 配置文件中的任何内容?或者你只是运行源代码?添加您从哪里引用的来源的引用
  • 未更改 webpack 配置文件或任何其他配置设置。来源在这里:github.com/davezuko/react-redux-starter-kit
  • 你的 npm 版本是什么?
  • 2.15.9版本
  • 我认为你应该先更新 npm,然后再次构建进程

标签: reactjs npm webpack


【解决方案1】:

您可能已经在 localhost:3000 运行了另一台服务器。尝试在浏览器中点击它来查看。

【讨论】:

    【解决方案2】:

    如果您厌倦了处理 webpack 配置,请尝试Chalet Starter App。 它应用了create-react-app 之类的命令来引导您的应用程序,并且文件夹结构基于react-redux-starter-kit。请参阅Quick Overview 了解更多详情。如果您还有其他问题,欢迎提出问题。

    【讨论】:

    • 也许您应该真正描述一下您的项目如何解决 OPs 问题。我没有立即看到连接。
    • 感谢您的建议。我认为 OP 的问题很难用 react-redux-starter-kit 或 express-react-redux-starter 配置 webpack。因此,使用命令行可能会减少工作量,并且 OP 可以很快掌握该工具包。
    猜你喜欢
    • 1970-01-01
    • 2016-06-05
    • 1970-01-01
    • 2020-03-08
    • 2017-11-08
    • 1970-01-01
    • 2023-02-03
    • 2016-09-08
    • 2023-01-03
    相关资源
    最近更新 更多