1

I think I accidentally installed Foreverjs somewhere and started it. Every time I kill this process another one takes its place![enter image description here]1

I have no idea where forever might be (or if thats actually whats causing it) because I install it locally.

Dylan Harness
  • 719
  • 1
  • 9
  • 20

3 Answers3

2

Take a look at Where does npm install packages? and npm folders documentation

Local install (default): puts stuff in ./node_modules of the current package root.

Global install (with -g): puts stuff in /usr/local or wherever node is installed.

run which forever to get the path where its installed and uninstall it with

  • forever stopall
  • npm uninstall forever if its globally installed add -g
Community
  • 1
  • 1
Gntem
  • 6,949
  • 2
  • 35
  • 48
  • Hey thanks! As I mentioned, it is a local install so I cannot use forever in the command-line like that. The issue was that I had many many different projects scattered everywhere with their own node_modules folders, not that I didn't know that npm installs things into the node_modules folder – Dylan Harness May 15 '16 at 20:37
2

If it restarts itself it means there is a parent process monitoring. Find the parent process and kill it first ps -o ppid= -p PID.

1

Turns out I had run the same script on PM2 on both a root user and of my new privileged user. The root user kept restarting the process with PM2 every time i killed it and its parent. So I did this

sudo su
pm2 status //to check pm2 processes
pm2 delete process_name //to delete the process
exit 
pm2 start "yarn start" --name process_name

Hope this helps save someone else's time

Ian Samz
  • 1,743
  • 20
  • 20