English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Solution to Node.js connect ECONNREFUSED Error

I have been preparing Angularjs recently +node.js demo encountered this error in my mac development, as follows:

events.js:71
throw arguments[1]; // Unhandled 'error' event
^
Error: connect ECONNREFUSED
at errnoException (net.js:770:11)
at Object.afterConnect [as oncomplete] (net.js:761:19)

Finally, I found the solution on stackoverflow. This is mainly due to the fact that the last node.js server process is still running and has not been closed. Therefore, we need to kill this process. The operation on mac is as follows:

ps aux | grep node

twer 7668 4.3 1.0 42060 10708 pts/1 Sl+ 20:36 0:00 node server
twer 7749 0.0 0.0 4384 832 pts/8 S+ 20:37 0:00 grep --color=auto node

You can see the process PID from the output7668Since it is in use, we must kill this stubborn process and run kill -9 7668. Ok, one-click solution, you can restart the server.

I hope this article can help friends who encounter such problems, thank you all for your support of this site!

Declaration: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (Please replace # with @ when sending an email for reporting, and provide relevant evidence. Once verified, this site will immediately delete the suspected infringing content.)

You May Also Like