Page 1 of 1

Upgrade Node.js and Node-Red

Posted: January 4th, 2020, 9:23 pm
by Kah
By default the Node-red and Node.js supplied by the recovery is way too ancient for our liking. One major concern is that all recent palettes require a somehow up to date installation of Node-red to function.

There are 2 components to upgrade, Node-red and Node.js

1) Key in the following commands:

Code: Select all

npm cache clean -f
npm install -g n
n stable
2) You WILL get an error and a bunch of no such file or directory.

Code: Select all

tar: unrecognized option '--strip-components=1;
3) This is because the default Busybox and tar is out of date and does not support the strip command. Click on my other post to upgrade tar and resume later.

4) Depending your version, remove the directory created earlier. Key in

Code: Select all

root@hmibsc:~# n rm 13.5.0
5) Key in n latest to install the latest version

Code: Select all

root@hmibsc:~# n latest
Congrats your Node.js is now up to date.

Reboot your device before continuing.

6) Key in npm install -g --unsafe-perm node-red to upgrade Node-red.

Code: Select all

root@hmibsc:~# npm install -g --unsafe-perm node-red
Reboot and you're done.