首页 > Web开发 > 详细

解决运行nodejs代码Error: listen EADDRINUSE

时间:2014-02-12 03:40:05      阅读:1907      评论:0      收藏:0      [点我收藏+]

at the first,

record this:

bubuko.com,布布扣
root@xxx:~/hexo# hexo server
[error] Error: listen EADDRINUSE
Error: listen EADDRINUSE
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1039:14)
    at listen (net.js:1061:10)
    at Server.listen (net.js:1135:5)
    at Function.app.listen (/root/.nvm/v0.10.25/lib/node_modules/hexo/node_modules/express/lib/application.js:533:24)
    at /root/.nvm/v0.10.25/lib/node_modules/hexo/lib/plugins/console/server.js:86:9
    at /root/.nvm/v0.10.25/lib/node_modules/hexo/lib/post/load.js:67:7
    at /root/.nvm/v0.10.25/lib/node_modules/hexo/node_modules/async/lib/async.js:116:25
    at /root/.nvm/v0.10.25/lib/node_modules/hexo/node_modules/async/lib/async.js:24:16
    at exports.post (/root/.nvm/v0.10.25/lib/node_modules/hexo/lib/plugins/generator/asset.js:50:3)
bubuko.com,布布扣

because i modify the hexo default port 4000 to 80 with config file _config.yml

port 80 is used other application,

so

find the process and kill it

the command:

root@xxxxx:~/hexo# fuser -n tcp 80
80/tcp:                705   715   716   717   718
root@xxxxx:~/hexo# kill 705

then generate and start hexo

bubuko.com,布布扣
root@xxxxx:~/hexo# hexo generate
[info] Files loaded in 0.217s
[create] Public: archives/index.html
[create] Public: archives/2014/02/index.html
[create] Public: index.html
[create] Public: archives/2014/index.html
[create] Public: 2014/02/11/hi/index.html
[create] Public: 2014/02/11/hello-world/index.html
[info] 6 files generated in 0.344s
root@xxxxx:~/hexo# hexo server
[info] Hexo is running at localhost:80/. Press Ctrl+C to stop.
bubuko.com,布布扣

 

OK!

解决运行nodejs代码Error: listen EADDRINUSE

原文:http://www.cnblogs.com/lidonghao/p/3545161.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!