Stop node.js program from command line

后端 未结 19 2329
无人及你
无人及你 2020-11-29 14:51

I have a simple TCP server that listens on a port.

var net = require(\"net\");

var server = net.createServer(function(socket) {
    socket.end(\"Hello!\\n\"         


        
19条回答
  •  余生分开走
    2020-11-29 14:52

    Ctrl+Z suspends it, which means it can still be running.

    Ctrl+C will actually kill it.

    you can also kill it manually like this:

    ps aux | grep node
    

    Find the process ID (second from the left):

    kill -9 PROCESS_ID
    

    This may also work

    killall node
    

提交回复
热议问题