Node-Red Update issue after ubuntu update

I ran into an issue today that I was able to simply resolve after some google searching but wanted to mention it here in case there is an underlying error that could be resolved.

I have been running Ubuntu Server 64Bit on a small server for a couple of years now as a "Main Node-Red" instance, most recently updated to node-red 1.05 and acting as a central Node-red and MQTT point for a variety of SBC node-red instances. I have updated Ubuntu distributions as they have been released and do not recall any issues with node-red at those times, but today after updating to 20.04 I noticed that there was a new node-red release so I ran the script from the documentation as I always do, and ran into an issue.

I said yes to the update, and no to the Pi specific nodes, and the script uninstalled node-red, checked my node.js, and then errored out with a "Failed to install node.js" message.

I ran node -v and confirmed I still had Node.js 10.19 installed.

I checked the install log and saw this:

Found global nodes:   :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package nodered
Already have nodejs v10.19.0
Now install nodejs

I ran npm -v and was told it was not installed. I ran apt install npm and it added a large number of packages, and after this the install worked.

I'm mostly posting this in case anyone else runs into the same issue and comes searching for an answer, but also wanted to mention it in case the script or install instructions should be updated to address any potential issues with Ubuntu 20.04 installations.

If npm is not installed - that usually means you have somehow got the apt version of nodejs installed rather than the one from nodejs.org which the script installs. I'm not going to suggest you break it all again now - but you will find that fixes and patches turn up on nodejs.org more rapidly that the ubuntu repos. Eg v10 is currently at 10.20.1 and npm at 6.14.5

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.