作为入门书,我是 node 新手,我尝试了 npm install ws@3.3.2 --save-dev --save-exact
来自 https://github.com/ionic-team/ionic-cli/issues/2922用于解决以下问题。
node server.js
Creating new shopping list item
Creating new shopping list item
Creating new shopping list item
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::8080
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Function.listen (C:\Users\Rob\WebProjects\npm-script-example\node-shoppin g-list-v1\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (C:\Users\Rob\WebProjects\npm-script-example\node-shop ping-list-v1\server.js:34:5)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-shopping-list-v1@0.0.1 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-shopping-list-v1@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Rob\AppData\Roaming\npm-cache\_logs\2018-01-25T05_03_00_40 4Z-debug.log
我的 repo在这里...对于我在 Windows 上的值(value)。我应该如何解决 js.183 错误?
最佳答案
我用 localhost
替换了 IP 地址,它对我有用:
之前:
server.listen(3000, '**old ip address**');
之后:
server.listen(3000, '**localhost**');
我尝试了很多解决方案,但没有一个奏效。试试这个,我希望它会有所帮助。
关于javascript - Node.js调试js :183,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48436377/