How to stop nodejs script running in the background?
Launched a nodejs script in the background by appending & to the command
nodejs ./app/index.js &
How now to stop the execution of this script without killing himself nodejs?
3 answers
ps-l | grep node
look pid (typically 3 column)
kill -9 {pid}
where {pid} pid from the previous command
p.s. use pm2 to run in production
kill
to stop the script is to kill the nodejs.
You still want to stop him?
Well, Yes to use pm2/supervisor/etc
Find more questions by tags Node.jsPuTTY