Read the statement by Michael Teeuw here.
Automatically terminate the process after NPM Run serve
-
Hello everyone, after NPM run serve you need CTRL + C or something to stop the process, but I want it to stop automatically, what should I do
-
@史新瑞 npm run serve This command
-
@史新瑞 use pm2 to launch the process
my scripts, provide pm2 control, and using the installers/mm.sh
which u can change to just launch server mode
then you can pm2 start,stop, restart the defined process
see https://github.com/sdetweil/MagicMirror_scripts
fixuppm2
last link on the page
the script sets up to launch the app at boot time as well, and pm2 will restart any app that fails…
-
@sdetweil Can you do this by modifying the serve.js file or the main.js file
-
-
@sdetweil I am a Chinese and my English is not very good. I can only communicate with you through translation software. I am very glad to meet you and honored to get your guidance
-
@史新瑞 understand… I cannot speak or read Chinese either!..
-
@sdetweil Thank you. I’ll try it now
-
@史新瑞 said in Automatically terminate the process after NPM Run serve:
Hello everyone, after NPM run serve you need CTRL + C or something to stop the process, but I want it to stop automatically, what should I do
Try putting a space then & that works for me on a couple of different projects I am running. Like my DHCP server Hope it helps.
-
@plainbroke Thank you