2016-04-11 52 views
1

当我尝试使用'npm start'运行我的应用程序时,会引发此错误。我已经更新了Node和NPM,但错误仍然会导致此错误。我想知道他们是否是KrakenJS的问题?当我运行'npm start'时,节点JS错误,也许是KrakenJS?

在此先感谢

> node server.js 
 

 
Mon, 11 Apr 2016 13:41:08 GMT uncaughtException listen EADDRINUSE :::8000 
 
Error: listen EADDRINUSE :::8000 
 
    at Object.exports._errnoException (util.js:890:11) 
 
    at exports._exceptionWithHostPort (util.js:913:20) 
 
    at Server.__dirname.Server.Server._listen2 (net.js:1230:14) 
 
    at listen (net.js:1266:10) 
 
    at Server.__dirname.Server.Server.listen (net.js:1362:5) 
 
    at Object.<anonymous> (/Users/.../server.js:14:8) 
 
    at Module._compile (module.js:413:34) 
 
    at Object.Module._extensions..js (module.js:422:10) 
 
    at Module.load (module.js:357:32) 
 
    at Function.Module._load (module.js:314:12) 
 

 
npm ERR! Darwin 14.5.0 
 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 
 
npm ERR! node v5.10.1 
 
npm ERR! npm v3.8.3 
 
npm ERR! code ELIFECYCLE 
 
npm ERR! [email protected] start: `node server.js` 
 
npm ERR! Exit status 1 
 
npm ERR! 
 
npm ERR! Failed at the [email protected] start script 'node server.js'. 
 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
 
npm ERR! If you do, this is most likely a problem with the testapp package, 
 
npm ERR! not with npm itself. 
 
npm ERR! Tell the author that this fails on your system: 
 
npm ERR!  node server.js 
 
npm ERR! You can get information on how to open an issue for this project with: 
 
npm ERR!  npm bugs testapp 
 
npm ERR! Or if that isn't available, you can get their info via: 
 
npm ERR!  npm owner ls testapp 
 
npm ERR! There is likely additional logging output above.

+0

如果您导航到'http:// localhost:8000',会显示什么? – RhysO

回答

1

它看起来像什么东西已在侦听端口8000尝试运行:

lsof -i:8000 

看看它是否列出了过程。你也可以检查http://localhost:8000

2

看起来好像你试图运行在端口8000的服务器和一些已经在使用它。

Mon, 11 Apr 2016 13:41:08 GMT uncaughtException listen EADDRINUSE :::8000 
Error: listen EADDRINUSE :::8000 

尝试选择不同的端口为您的服务器或运行一些诊断,看是否已经绑定在8000

+0

哦,是的多么尴尬!我打开并隐藏了另一个终端窗口。谢谢! – lucasjohnson

1

EADDRINUSE错误告诉你所使用的端口已被其他程序使用,并且不能被你的应用程序使用。 尝试检查该端口上的应用程序或仅更改端口本身。