Node js +Error: listen EADDRINUSE + Unhandled 'error' event

倖福魔咒の 提交于 2019-12-03 11:45:37
Patrick

Error: listen EADDRINUSE

This error means that you already have another process listening on port 3000.

Here is how to find out which process it is on windows

C:\> netstat -a -b
(add -n to stop it trying to resolve hostnames, which will make it a lot faster)

Edit: +1 for Dane's recommendation for TCPView. Looks very useful!

-a Displays all connections and listening ports.

-b Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions. -n Displays addresses and port numbers in numerical form.

As Patrick has said Error: listen EADDRINUSE

This error means that you already have another process listening on port 3000.

If you used Nodeclipse to run Node.js application, you can see list of currently running apps in Debug View (shown by default in Node perspective). Then you can terminate selected or all, restart etc.

Yes, Debug View does not includes only debugged apps. It should have been named Launch View, but it is standard View in Eclipse, we name it as it is named.

Also running apps can be terminated individually by closing its Console (using red square icon)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!