Node. js connect ECONNREFUSED error solution, connecteconnrefused
Recently I encountered this error in my mac development when preparing Angularjs + node. js demo, as shown below:
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, find a solution in stackoverflow. This is mainly because the last node. js server process is still running and not closed, so we need to kill the process and run it on mac:
Ps aux | grep node
Twer 7668 4.3 1.0 42060 10708 pts/1 Sl + node server
Twer 7749 0.0 0.0 4384 832 pts/8 S + grep -- color = auto node
From the output, we can see that the PID7668 process is in use. Therefore, we must kill this stubborn molecule and run kill-9 7668. OK. You can restart the server with one click.
Thanks for your support for this site!