Skip to content

Instantly share code, notes, and snippets.

@suhas-karanth
Last active March 28, 2024 00:42
Show Gist options
  • Save suhas-karanth/d2a0ed01dd451be9f740aa14c5ee6fa5 to your computer and use it in GitHub Desktop.
Save suhas-karanth/d2a0ed01dd451be9f740aa14c5ee6fa5 to your computer and use it in GitHub Desktop.
Upgrading node and pm2 using nvm

Update node using nvm

nvm install 6.3
nvm alias default 6.3
nvm use 6.3

Install and Update pm2

npm install pm2@latest -g ; pm2 update
sudo update-rc.d -f pm2-init.sh remove [--force]
pm2 startup ubuntu

To switch any saved processes to use new node version

pm2 restart all
@byteab
Copy link

byteab commented Jun 16, 2021

can you explain what sudo update-rc.d -f pm2-init.sh remove [--force] is doing ?

@sudo-suhas
Copy link

I think it would be uninstalling the previous auto start script setup by previous version of pm2. However this gist is from a long time ago and I wouldn't recommend relying on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment