Weird issues trying to update

Hi,

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.

First some versions:

pi@mynuc:~/.node-red $ uname -a
Linux mynuc 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux
pi@mynuc:~/.node-red $ node -v
v10.24.0
pi@mynuc:~/.node-red $ npm -v
5.8.0
pi@mynuc:~/.node-red $ nvm -v
0.37.2
pi@mynuc:~/.node-red $

Upgrade command:

pi@mynuc:~/.node-red $ bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16

Output from above command:

This can take 20-30 minutes on the slower Pi versions - please wait.

Stop Node-RED :heavy_check_mark:
Remove old version of Node-RED :heavy_check_mark:
Remove old version of Node.js :heavy_check_mark: 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

nodered-install.log (22.9 KB)

pi@mynuc:~/.node-red $

what does
apt policy nodejs
show?

Hi Colin,

Here's the output of that command:

pi@mynuc:~/.node-red $ sudo apt policy nodejs
nodejs:
  Installed: 10.24.0~dfsg-1~deb10u1
  Candidate: 10.24.0~dfsg-1~deb10u1
  Version table:
 *** 10.24.0~dfsg-1~deb10u1 500
        500 http://ftp.debian.org/debian buster/main i386 Packages
        500 http://security.debian.org buster/updates/main i386 Packages
        100 /var/lib/dpkg/status
pi@mynuc:~/.node-red $ 

I tried following the instructions at this site to install a specific version of node,js but could just not get it to work.

How to Install Node.js on Debian 10/9/8

Is there a file /etc/apt/sources.list.d/nodesource.list and if so what is in it?

Colin,

Yes that file is present.

pi@mynuc:/etc/apt/sources.list.d $ cat nodesource.list
deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x buster main
deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x buster main
pi@mynuc:/etc/apt/sources.list.d $

Admin edit. Triple backticks added around the text so that the forum does not mess with it.

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.

Colin,

Exact same results with --node14

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 :heavy_check_mark:
Remove old version of Node-RED :heavy_check_mark:
Remove old version of Node.js :heavy_check_mark: 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

pi@mynuc:~/.node-red $

Colin,

Anticipating a request to try --node12, I tried and same results.

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.

Colin,

I'm almost positive it's 64bit. Isn't that what this means?

pi@mynuc:~/.node-red $ uname -a
Linux mynuc 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux

I said it was weird! LOL

pi@mynuc:~/.node-red $ node

arch
Thrown:
ReferenceError: arch is not defined
process
process {
title: 'node',
version: 'v10.24.0',
versions:
{ http_parser: '2.9.4',
node: '10.24.0',
v8: '6.8.275.32-node.59',
uv: '1.24.1',
zlib: '1.2.11',
brotli: '1.0.7',
ares: '1.14.0',
modules: '64',
nghttp2: '1.41.0',
napi: '7',
openssl: '1.1.1d',
icu: '63.1',
unicode: '11.0',
cldr: '34.0',
tz: '2018e' },
arch: 'ia32',
platform: 'linux',
release:
{ name: 'node',
lts: 'Dubnium',
sourceUrl:
'https://nodejs.org/download/release/v10.

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.

Colin,

Here is contents of that directory.

pi@mynuc:/etc/apt/sources.list.d $ ls -l
total 60
-rw-r--r-- 1 root root  72 Nov  4  2019 docker.list
-rw-r--r-- 1 root root  72 Nov  4  2019 docker.list.save
-rw-r--r-- 1 root root 189 Nov  4  2019 google-chrome.list.save
-rw-r--r-- 1 root root  53 Nov  4  2019 grafana.list
-rw-r--r-- 1 root root  53 Nov  4  2019 grafana.list.save
-rw-r--r-- 1 root root  54 Nov  4  2019 influxdb.list
-rw-r--r-- 1 root root  54 Nov  4  2019 influxdb.list.save
-rw-r--r-- 1 root root 192 Jun  7 07:22 microsoft-edge-dev.list
-rw-r--r-- 1 root root 204 Sep 11 15:46 nodesource.list
-rw-r--r-- 1 root root 254 May 12 12:48 ookla_speedtest-cli.list
-rw-r--r-- 1 root root 188 Nov  4  2019 raspi.list
-rw-r--r-- 1 root root 187 Nov  4  2019 raspi.list.save
-rw-r--r-- 1 root root  41 Mar 17 07:30 vscode.list
-rw-r--r-- 1 root root  65 Nov  4  2019 webmin.list
-rw-r--r-- 1 root root  65 Nov  4  2019 webmin.list.save
pi@mynuc:/etc/apt/sources.list.d $ 

Colin,

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.

It is generally recommended not to use n or nvm with node-red. Been mentioned many times as the cause of installation issues.

Search nvm on this forum. Lots of install related issues.

1 Like

Hi Steve,

Believe me I would have liked to have used the supplied install methods but as I mentioned above I'm having problems.

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.

dceejay,

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.

Doug

That is because the script saw that 16 was installed so did not try to update it.

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