I have an Intel NUC that' has been running Debian 10 reliably for several years, I use it as a general purpose Linux IOT server. I used @scargill "The Script" to install all the IOT programs. I consider myself moderately handy with Linux but have exhausted my skillset on this one.
Recently I decided to upgrade to Node-RED 2.06 and that's where things went South on me, As usual I've backed up my system. Backed up flows to Github. Then ran the Running on Raspberry Pi, Installing and Upgrading Node-RED and received the error show below.
I tried my best to force install a later version of node out of frustration but that led to further frustration.
With that I'm submitting this request for help and would appreciate whatever you can offer.
This can take 20-30 minutes on the slower Pi versions - please wait.
Stop Node-RED
Remove old version of Node-RED
Remove old version of Node.js v10.24.0
Install Node.js 16 LTS ā Bad install: Node.js v10.24.0 Npm missing - Exit
Clean npm cache
Install Node-RED core
Move global nodes to local
Npm rebuild existing nodes
Install extra Pi nodes
Add shortcut commands
Update systemd script
Any errors will be logged to /var/log/nodered-install.log
That looks ok, but it is not finding nodejs 16 (as is shown by the apt policy command). I wonder whether nodesource does not have a Debian build of 16. Try it with 14 instead.
Running Node-RED update for user pi at /home/pi on debian
This can take 20-30 minutes on the slower Pi versions - please wait.
Stop Node-RED
Remove old version of Node-RED
Remove old version of Node.js v10.24.0
Install Node.js 14 LTS ā Bad install: Node.js v10.24.0 Npm missing - Exit
Clean npm cache
Install Node-RED core
Move global nodes to local
Npm rebuild existing nodes
Install extra Pi nodes
Add shortcut commands
Update systemd script
Any errors will be logged to /var/log/nodered-install.log
I see it has i386 there. Is that a 32 bit processor? If so then that is the problem I think. I don't know how to install nodejs on a 32 bit intel processor. I believe nodesource does not have them.
i386 definitely suggests 32 bit so I think something is messed up in your sources. What is in /etc/apt/sources.list? When pasting it in use the </> button at the top of the forum entry window, or surround it with triple backticks, to stop the forum messing with it.
I just updated the nodesource to 16.x.
Then with "nvm install node" I managed to get Node v16.9.1 x64 installed.
Then installed Node-RED with:
sudo npm install -g --unsafe-perm node-red
Node-RED runs and my flows are running. I've noticed some of the nodes in the palette have yellow exclamation marks with errors like "module_not_found" , "type_already_registered"
If I start Node-Red with systemctl I get Flows stopped due to missing node types. If I start with "node-red" everything runs okay other than the node errors mentioned.
So the weirdness here is that uname is reporting Linux mynuc 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux which makes it look like it is x86_64 - 64bit capable and yet it seems to be 32 bit (which should report i686) - so either this is a weird processor... or somehow a 32 bit OS has been installed on it in the first place. Either way it is enough to confuse the install script with then tries to install the 64bit node.js and fails... leaving the "old" nodev10 in place which isn't enough to run Node-RED v2.
I don't think there is a way to migrate from 32 to 64 bit OS - so you can either do what you have done using n or nvm (but may confuse things when trying to run as a service etc) as they typically only run for the current user and not when running as a service... or uninstall nodejs10 and manually install nodejs14 for x86 from the unofficial build site ( Index of /download/release/v14.17.6/ ) as node.js stopped building for 32 bit officially a while back.
Thanks for the insight. I agree with you there is something fundamentally wrong with this setup.
It's aged enough that it's time I start a plan on replacing it. This just might be the kick in the shorts that starts that process.
One more bit of weirdness is that once I "nvm" installed node 16 I then took a chance and ran the node-RED install script and it did it's thing without errors. I did have to do some cleaning up of individual nodes that had problems from all these attempts at upgrading.
I want to thank Colin, Steve-Mcl and you for helping with your time and knowledge.