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

后端 未结 16 2061
名媛妹妹
名媛妹妹 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:34

    For windows machine (I'm on windows 10), if CTRL + C (Cancel/Abort) Command on cli doesn't work, and the screen shows up like this:

    Try to hit ENTER first (or any key would do) and then CTRL + C and the current process would ask if you want to terminate the batch job:

    Perhaps CTRL+C only terminates the parent process while npm start runs with other child processes. Quite unsure why you have to hit that extra key though prior to CTRL+ C, but it works better than having to close the command line and start again.

    A related issue you might want to check: https://github.com/mysticatea/npm-run-all/issues/74

提交回复
热议问题