Stop node.js program from command line

后端 未结 19 2303
无人及你
无人及你 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:55

    on linux try: pkill node

    on windows:

    Taskkill /IM node.exe /F
    

    or

    from subprocess import call
    
    call(['taskkill', '/IM', 'node.exe', '/F'])
    

提交回复
热议问题