Hi,
You can also try these commands from the command line or an exec node:
Command line:
cd ~/.node-red
npm install
npm rebuild
pm2 restart all
exec node:
cd ~/.node-red ; npm install ; npm rebuild ; pm2 restart all
These commands will update all libraries and rebuild all libraries for the current nodejs install.
Or you can back up your flows using node-red’s export and do a factory reset via the web configuration UI > System > Profile > Default Configuration Section > Restore to Factory Default Configuration.
nvm is useful, but I would just recommend using these commands to update without the version management layer as it can cause odd issues with compiled libraries like the serial port library if you’re not used to it or don’t set default runtimes etc.
To update I would recommend these commands:
Commands:
sudo n $version
sudo n prune
sudo reboot
After reboot run these commands:
sudo npm install -g --unsafe-perm node-red
cd ~/.node-red
npm rebuild
pm2 restart all
You might not have to reboot after the n prune command, but I did during my testing to make sure it was a clean service environment.
