I try to update my Node-Red via the script on a RPi3 with a buster installation.
The script detects nodejs v10.24.1 an uninstalls it. But then installs v10.24.1 again even when I force it to install nodejs 18 (--node18).
I then manually uninstalled nodejs and tried to run the script and it again installed nodejs v10.24.1.
Ok, that worked after I solved another problem which came up during the process but after installing node18 and running the script my node-red installation is completely screwed up.
I guess I´ll do a clean install of everything.
Just have to figure out how to copy my node red and zigbee2mqtt data bevore.
thx again.
Depends whether you are going to completely wipe the device but Node-RED is fully encapsulated in the ~/.node-red userDir folder so just take a complete copy minus the ~/.node-red/node_modules/ folder which is enormous and easily recreated.
For Zigbee2MQTT, make a copy of the /opt/zigbee2mqtt/data folder. The official update process for Zigbee2MQTT overwrites everything anyway so having a backup of your data folder is important. This is the script I use to update it:
# Stop Zigbee2MQTT and go to directory
sudo systemctl stop zigbee2mqtt
cd /opt/zigbee2mqtt
# Backup configuration
cp -R data data-backup
# Update
git checkout HEAD -- npm-shrinkwrap.json
git pull
npm ci
# Restore configuration
cp -R data-backup/* data
rm -rf data-backup
# Start Zigbee2MQTT
sudo systemctl start zigbee2mqtt