Node.jsconnectECONNREFUSED错误

   最近在准备Angularjs +node.js demo的时候在我的mac开发中遇见此错误,如下:
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)
 
最后在stackoverflow找到解决方案,这主要由于上一次node.js server进程仍然还在运行没关闭掉,所以我们需要杀掉此进程,在mac上操作为:
 
ps aux | grep node
 
twer   7668 4.3 1.0 4206010708 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
从输出可以看见进程PID7668在使用,所以我们必须杀掉这顽固分子,运行kill -9 7668.Ok,一键搞定,可以重新开启server了。
 

 

我们提供的服务有:成都网站制作、网站建设、外贸网站建设、微信公众号开发、网站优化、网站认证、兴隆ssl等。为超过千家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的兴隆网站制作公司


网页名称: Node.jsconnectECONNREFUSED错误
分享链接:http://myzitong.com/article/gcdhco.html