简体   繁体   English

Node.js调试js:183

[英]Node.js Debugging js:183

As a primer, I'm new to node and I have tried npm install ws@3.3.2 --save-dev --save-exact from https://github.com/ionic-team/ionic-cli/issues/2922 for resolving the below issue. 作为入门,我是Node的新手,我尝试从https://github.com/ionic-team/ionic-cli/issues/尝试npm install ws@3.3.2 --save-dev --save-exact 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

My repo is here...for what it's worth I'm on Windows. 我的仓库在这里...对于我在Windows上值得的东西。 How should I resolve the js.183 error? 我该如何解决js.183错误?

Your error is, Error: listen EADDRINUSE :::8080 so something else is already running on port 8080. You will need to find out what is using it, you can run the following in an elevated command prompt on Windows: netstat -a -b 您的错误是: Error: listen EADDRINUSE :::8080因此端口8080上已经在运行其他内容。您将需要查找正在使用的内容,可以在Windows的提升命令提示符下运行以下命令: netstat -a -b

Once you have identified what is running on that port, you will need to kill it, or if it is something you need to keep running, you will need to choose a different port for your app to run on. 一旦确定了该端口上正在运行的端口,就需要将其杀死,或者如果需要继续运行该端口,则需要为应用程序选择其他端口。

I replaced IP address with localhost and it worked for me: 我用localhost替换了IP地址,它对我有用:

BEFORE: 之前:

server.listen(3000, '**old ip address**');

AFTER: 后:

server.listen(3000, '**localhost**');

I tried many solutions but none of them worked. 我尝试了许多解决方案,但没有一个起作用。 Try this I hope it will help. 试试这个,希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM