How can I use npm start in Jenkins Execute Windows Batch Command to run server in background? This command execute correctly right now but blocked my job. I've tried pm2, Start-Job, forever but it doesn't work. I have to run npm start command in prticular location through Jenkins and my job must to end.
You could use
screen -d -m -S screen.npmStart npm start
This opens a detached screen with name "screen.npmStart" and executes npm start
in that screen.
Use screen -list
to show the available screen sessions.
Execute the following command in your post build action to be sure the screen is killed after your main job has finished.
screen -S screen.npmStart -X quit || true
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.