Updating Node.js for Shinobi

Node.js version 20 or 18 are the currently recommended versions.

1. Update System (can skip if you did this recently)

sudo apt update
sudo apt -y upgrade

2. Install Node.js repo

sudo apt update
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -

3. Now you can update node.js with the following

sudo apt -y install nodejs

4. Update npm with the following

npm i npm -g

5. You may also consider updating these critical packages but if you already have a stable version of Shinobi running its not necessary.

sudo apt -y install gcc g++ make

6. Update PM2, the daemonizer

npm install pm2@latest -g

7. Reinstall Shinobi modules with the new node version as a base.

cd /home/Shinobi
rm -rf node_modules
sh UPDATE.sh
pm2 restart all