node.js - npm start 今天失败并出现以下错误

标签 node.js reactjs npm

当我今天在react上测试我的代码时,我无法启动开发服务器,错误显示如下。

[email protected] start /Users/linyujie/Files/Softprofiles/SourceCode/successmanagerreact npm run serve:dev

> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d1bcb0a5b4a3b8b0bd91e3ffe1ffe1" rel="noreferrer noopener nofollow">[email protected]</a> serve:dev /Users/linyujie/Files/Softprofiles/SourceCode/successmanagerreact
> webpack-dev-server --host 0.0.0.0 --port 3000 --open --env dev

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

Error: listen EADDRINUSE 0.0.0.0:3000
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at Server.setupListenHandle [as _listen2] (net.js:1351:14)
    at listenInCluster (net.js:1392:12)
    at doListen (net.js:1501:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:678:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d2bfb3a6b7a0bbb3be92e0fce2fce2" rel="noreferrer noopener nofollow">[email protected]</a> serve:dev: `webpack-dev-server --host 0.0.0.0 --port 3000 --open --env dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7815190c1d0a111914384a56485648" rel="noreferrer noopener nofollow">[email protected]</a> serve:dev 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!     /Users/linyujie/.npm/_logs/2018-06-25T04_55_36_232Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6c010d18091e050d002c5e425c425c" rel="noreferrer noopener nofollow">[email protected]</a> start: `npm run serve:dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0f626e7b6a7d666e634f3d213f213f" rel="noreferrer noopener nofollow">[email protected]</a> 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!     /Users/linyujie/.npm/_logs/2018-06-25T04_55_36_255Z-debug.log

最佳答案

端口 3000 正在使用中。尝试使用 netstat 查找正在使用该端口的进程的 PID。如果不需要,请停止/终止该进程。此链接对于 windows 可能很方便这是 mac查找正在端口上监听的进程。

关于node.js - npm start 今天失败并出现以下错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51016595/

相关文章:

javascript - 从包含 Promise 的对象数组中获取数据

node.js - Windows 中的 Topojson 构建失败

node.js - 释放 Node.js 中 Buffer 实例的内存

javascript - 使用 JEST 和 ESM 进行快速测试给我错误 "TypeError: Cannot assign to read only property ' sum' of object '[object Module]'"

eclipse - 有没有适用于 React JS 的 eclipse 插件

reactjs - 类型 'render' .ts(2339) 上不存在属性 'typeof React'

mysql - NodeJS 无法打开 MySQL 连接端口

node.js - Sinon 在执行 npm install 时没有安装

node.js - MongoDB:聚合,按多个字段分组

node.js - TypeError : this. add 不是 Node js应用程序中的函数