node本地服务启动报Error: listen EADDRINUSE


在启动一个本地静态服务的时候报了这个错误?如何解决?


 events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: listen EADDRINUSE
    at exports._errnoException (util.js:746:11)
    at Server._listen2 (net.js:1129:14)
    at listen (net.js:1155:10)
    at Server.listen (net.js:1240:5)
    at Function.app.listen (/usr/local/lib/node_modules/anywhere/node_modules/connect/lib/proto.js:183:24)
    at Object.<anonymous> (/usr/local/lib/node_modules/anywhere/bin/anywhere:76:5)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

node.js

chiseen 9 years, 7 months ago

找到原因了。。是同时开了另外一个进程


 ps | grep node


 kill <id>

三重快意男儿 answered 9 years, 7 months ago

EADDRINUSE 写成这样 E ADDR IN USE 应该就好理解了

socat answered 9 years, 7 months ago

pkill node

求鸡情求鸭力 answered 9 years, 7 months ago

Your Answer