How to update NODE.js, NPM and NodeRed?
I am trying to update NODE.js, NPM and NodeRed on my UNIPI NEURON S103-G.
I have found this document on how to do it. But it looks outdated - is it still valid to use this command from the document?
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbiandebpackage/master/resources/update-nodejs-and-nodered)
Thank you in advance! :)
The documentation is really old, but this command looks functional. As recently as last year, someone used it for an update (link to the Node-RED forum), but I didn't test it.
We will also soon release a new Node-RED OS with the current Node-RED v3. Which is also a certain possibility to update.
I can confirm that the command works on my Unipi Patron. Node-red upgrade from 2.2.2 to 3.0.2 worked well.
I had to use the "--node14" parameter to upgrade nodejs, because Node-red 3 doesn't support nodejs 12.
After running the script I had to reboot the Unipi with:
sudo /sbin/shutdown -r now
Official documentation (applicable to any Debian-based distribution):
@AVsetula Just today I tried updating my Neuron to the current Node/Node-RED versions. This was just after first boot from an SD card flashed with the neuron-node-red_image-20220607.0.zip. The update mysteriously failed, and it took me a while to realise that the problem was I had run out of disk space.
It seems the automatic resize of the rootfs that is supposed to happen at first boot did not, so I only have ~ 2GB of disk! Is this a known problem, or has something else gone wrong? I'm using a '16GB' RasPiKey, which is eMMC-based, but looks exactly like a normal SD card: at least it did to Balena Etcher. On the Neuron, fdisk tells me:
unipi@M203-sn499:~$ sudo fdisk /dev/mmcblk0 Welcome to fdisk (util-linux 2.33.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/mmcblk0: 14.6 GiB, 15634268160 bytes, 30535680 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x5f965ddd Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 8192 212991 204800 100M b W95 FAT32 /dev/mmcblk0p2 212992 4194303 3981312 1.9G 83 Linux Command (m for help): F Unpartitioned space /dev/mmcblk0: 12.6 GiB, 13489930240 bytes, 26347520 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes Start End Sectors Size 2048 8191 6144 3M 4194304 30535679 26341376 12.6G
(The reported capacity seems a bit low?) Is there a way to manually resize the partition, or should I just re-flash the RasPiKey and try again (there is nothing valuable on it as yet)?
OK I have sorted the partition issue thanks to UniPi tech support: manually resizing the SD card partition using gparted on another Linux system.
However I'm still looking for a guide to the 'official' way to upgrade nodeJS, npm and NodeRed on a UniPi Neuron. I'd like nodeJS 18 and Node-RED 3 if possible. The only documentation I came across regarded nodeJS 14 as 'new'!