我在使用基本的nodejs和express程序时遇到了麻烦。
问题是,当我使用npm start
哪个应运行节点。\ bin \ www时,出现以下错误:
C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api>npm start
[email protected] start C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api
node .\bin\www
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1042:14)
at listen (net.js:1064:10)
at Server.listen (net.js:1138:5)
at Function.app.listen (C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api\node_mo
dules\express\lib\application.js:556:24)
at Object.<anonymous> (C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api\bin\www:
7:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
npm ERR! [email protected] start: `node .\bin\www`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the cdc-api package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node .\bin\www
npm ERR! You can get their info via:
npm ERR! npm owner ls cdc-api
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! cwd C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api\npm-debug.log
npm ERR! not ok code 0
C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api>
这是npm-debug.log中的内容:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart [email protected]
7 info start [email protected]
8 verbose unsafe-perm in lifecycle true
9 info [email protected] Failed to exec start script
10 error [email protected] start: `node .\bin\www`
10 error Exit status 8
11 error Failed at the [email protected] start script.
11 error This is most likely a problem with the cdc-api package,
11 error not with npm itself.
11 error Tell the author that this fails on your system:
11 error node .\bin\www
11 error You can get their info via:
11 error npm owner ls cdc-api
11 error There is likely additional logging output above.
12 error System Windows_NT 6.2.9200
13 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
14 error cwd C:\Users\Moucheg\Desktop\projets\cdc\cdc-api
15 error node -v v0.10.32
16 error npm -v 1.4.28
17 error code ELIFECYCLE
18 verbose exit [ 1, true ]
我已经尝试了在互联网上找到的所有内容(重新安装节点,重新创建package.json,...),但我无法使其正常工作。
仅供参考,我在Windows 8上(如果有帮助)
预先感谢您对男人(和女孩;)的帮助。
错误“ EADDRINUSE”表示您尝试使用的端口已被系统使用。尝试更改应用程序中使用的端口或关闭正在使用它的任何程序。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句