Nodejs Express 报错之 listen EADDRINUSE

当你启动 nodejs服务报错:

>node app
Express server listening on port 80
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: listen EADDRINUSE
    at exports._errnoException (util.js:746:11)
    at Server._listen2 (net.js:1156:14)
    at listen (net.js:1182:10)
    at Server.listen (net.js:1267:5)
    at EventEmitter.app.listen (\node_modules\express\lib\application.js:559:24)
    at initApp (\app.js:27:7)
    at \node-app\config\config.js:42:7
    at \node-app\util\dbUtil.js:91:16
    at \node_modules\mongodb\lib\mongo_client.js:403:11
    at process._tickCallback (node.js:355:11)

 

报错原因:是由于80端口(你设置的nodejs端口)被占用

解决方案:关闭80端口程序(进程)或更换nodejs服务端口号

你可能感兴趣的:(nodejs)