search

Home  >  Q&A  >  body text

node.js http 服务开启之后怎么关闭

大家讲道理大家讲道理2863 days ago870

reply all(5)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 15:05:19

    ps -ef| grep node

    kill process ID

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:05:19

    ps -ef | grep node | grep -v grep | awk '{print $2}' | xargs kill -9

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 15:05:19

    I don’t recommend you use ps to view the process because you can’t see the port. At this time, the process occupying the port is killed, not the node process (if there are multiple ones).

    So you should:

    lsof -i:3000

    Check the pid and then kill ${pid}

    reply
    0
  • 阿神

    阿神2017-04-17 15:05:19

    killall node

    reply
    0
  • 黄舟

    黄舟2017-04-17 15:05:19

    Open terminal and enter
    ps -ax | grep node //找出所有node应用
    sudo kill :pid //找到你要杀死node进程的pid

    reply
    0
  • Cancelreply