How to restart a node.js server

后端 未结 9 1257
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-22 16:46

I\'ve installed and is running a node.js server on osx. I\'ve dled a chat module and is happily running it. I\'ve altered some pieces and need to restart the server to see t

9条回答
  •  猫巷女王i
    2020-12-22 17:05

    I understand that my comment relate with windows, but may be someone be useful. For win run in cmd:

    wmic process  where "commandline like '%my_app.js%' AND name='node.exe' " CALL Terminate
    

    then you can run your app again:

    node my_app.js
    

    Also you can use it in batch file, with escape quotes:

    wmic process  where "commandline like '%%my_app.js%%' AND name='node.exe' " CALL Terminate
    node my_app.js
    

提交回复
热议问题