zoukankan      html  css  js  c++  java
  • 解决运行nodejs代码Error: listen EADDRINUSE

    at the first,

    record this:

    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)

    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

    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.

    OK!

  • 相关阅读:
    重构代码
    我的菜单在母版页,如何更改菜单点击后的效果
    ASP.NET网页显示LED字体
    点击一次铵钮产生一个新文本框,分别输入值,然后获取
    linux不同信号之间发送信号测试
    UCOSII移植ARM的笔记
    C语言 return返回值的作用
    C语言 return没有返回值.
    linux c语言链表的简单应用之创建链表
    sizeof与strlen的用法
  • 原文地址:https://www.cnblogs.com/lidonghao/p/3545161.html
Copyright © 2011-2022 走看看