How to stop app that node.js express 'npm start'

后端 未结 16 2038
名媛妹妹
名媛妹妹 2020-12-07 11:00

You build node.js app with express v4.x then start your app by npm start. My question is how to stop the app? Is there npm stop?

16条回答
  •  再見小時候
    2020-12-07 11:22

    Check with netstat -nptl all processes

    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      1736/mongod     
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1594/sshd       
    tcp6       0      0 :::3977                 :::*                    LISTEN      6231/nodejs     
    tcp6       0      0 :::22                   :::*                    LISTEN      1594/sshd       
    tcp6       0      0 :::3200                 :::*                    LISTEN      5535/nodejs 
    

    And it simply kills the process by the PID reference.... In my case I want to stop the 6231/nodejs so I execute the following command:

    kill -9 6231
    

提交回复
热议问题