Problem with upgrading

This a follow-on to the topic
Problem with multiple context stores

Node Red was working ok on that RPi after the upgrade but since I couldn't be sure that the residual node.js v10.24.1 wouldn't cause problems in the future, I decided to just do a completely new install of the OS and Node Red. Everything is working fine on that RPi.

I'm now working on another RPi Node Red installation and have a more interesting problem. Now, even when I use the node red script with the --node16 option, I end up with nodejs v10.24.1, npm v6.14.12 AND Node-Red 2.1.3 I thought nodered v2.1.3 wouldn't install with nodejs v10.xx ...

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.1
  Install Node.js 16 LTS              ✔   v10.24.1   Npm 6.14.12
  Clean npm cache                     ✔
  Install Node-RED core               ✔   2.1.3
  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
All done.
pi@RPi3Bp:~ $ nodejs -v
v10.24.1
pi@RPi3Bp:~ $ npm -v
6.14.12
pi@RPi3Bp:~ $ apt-cache policy nodejs
nodejs:
  Installed: 10.24.1-1nodesource1
  Candidate: 10.24.1-1nodesource1
  Version table:
 *** 10.24.1-1nodesource1 500
        500 https://deb.nodesource.com/node_10.x buster/main armhf Packages
        100 /var/lib/dpkg/status
     10.24.0~dfsg-1~deb10u1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages

image

The log shows:

## Installing the NodeSource Node.js 16.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 https://deb.nodesource.com/node_10.x buster InRelease
Err:2 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
  403  Forbidden [IP: 52.35.82.45 443]
Hit:3 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:4 http://archive.raspberrypi.org/debian buster InRelease
Hit:5 http://packages.azlux.fr/debian buster InRelease
Reading package lists...
E: Failed to fetch https://dl.bintray.com/openhab/apt-repo2/dists/stable/InRelease  403  Forbidden [IP: 52.35.82.45 443]
E: The repository 'https://dl.bintray.com/openhab/apt-repo2 stable InRelease' is no longer signed.
Error executing command, exiting

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

Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.4 MB of archives.
After this operation, 76.7 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_10.x buster/main armhf nodejs armhf 10.24.1-1nodesource1 [14.4 MB]
Fetched 14.4 MB in 3s (4,683 kB/s)
Selecting previously unselected package nodejs.
(Reading database ... ^M(Reading database ... 5%^M(Reading database ... 10%^M(Reading database ... 15%^M(Reading database ... 20%^M(Readin$
Preparing to unpack .../nodejs_10.24.1-1nodesource1_armhf.deb ...
Unpacking nodejs (10.24.1-1nodesource1) ...
Setting up nodejs (10.24.1-1nodesource1) ...
Processing triggers for man-db (2.8.5-2) ...

Versions: node:v10.24.1 npm:6.14.12
npm WARN using --force I sure hope you know what you are doing.
Now install Node-RED
/usr/bin/node-red -> /usr/lib/node_modules/node-red/red.js
/usr/bin/node-red-pi -> /usr/lib/node_modules/node-red/bin/node-red-pi

> bcrypt@5.0.1 install /usr/lib/node_modules/node-red/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! install response status 404 Not Found on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-$
node-pre-gyp WARN Pre-built binaries not installable for bcrypt@5.0.1 and node@10.24.1 (node-v64 ABI, glibc) (falling back to source compi$
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_li$
make: Entering directory '/usr/lib/node_modules/node-red/node_modules/bcrypt/build'
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  AR(target) Release/obj.target/../node-addon-api/nothing.a
  COPY Release/nothing.a
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /usr/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/usr/lib/node_modules/node-red/node_modules/bcrypt/build'
npm WARN notsup Unsupported engine for node-red@2.1.3: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: node-red@2.1.3
npm WARN notsup Unsupported engine for fs-extra@10.0.0: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: fs-extra@10.0.0
npm WARN notsup Unsupported engine for node-red-admin@2.2.1: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: node-red-admin@2.2.1

+ node-red@2.1.3
added 290 packages from 371 contributors in 62.859s
2.1.3
Now create basic package.json for the user and move any global nodes
Running npm rebuild

> protobufjs@6.8.8 postinstall /home/pi/.node-red/node_modules/protobufjs
> node scripts/postinstall
 
(lots more, but I assume not relavent)

I'm not posting this to get help (unless there is something obvious that I'm doing wrong), I feel I've received more than my share of help on the other topic. Node Red is working on this RPi, and I don't want to do a fresh OS install as there are a number of other packages I have on this RPi.

I'm posting this in case it might show some issues with the script (since I can't find many other posts regarding the script I'm assuming there is something unique about my builds rather than a problem with the script).

I had thought that nodered v 2.xx would not run with node.js v10.xx but it seems to working fine.

That has prevented the script proceeding correctly, so it has not removed the old nodejs version. It should check for an error return but apparently doesn't. Did you manually include that repository? If you did not add it yourself I am surprised it is part of the standard Raspbian image. Which image did you install?

As for the error itself I don't know whether it is a temporary issue with the repo (I can't access it here at the moment) or whether it is a permanent issue.

This is actually coming from the nodejs install script itself that we don't maintain... (we call theirs as part of ours... )
@Glake01 - Could you try just running this curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - on it's own - hopefully it should fail in the same way.
And the fix will be to remove that openhab repo from the /etc/apt/sources

Thanks for your responses!

That is an openHab version 2 package that I installed manually. There's a new version out but I don't want the new version so just as happy that it didn't find the new version.

Yes it did fail.

pi@RPi3Bp:~ $ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -

## Installing the NodeSource Node.js 16.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 https://deb.nodesource.com/node_10.x buster InRelease
Err:2 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
  403  Forbidden [IP: 34.212.193.227 443]
Get:3 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Get:4 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Hit:5 http://packages.azlux.fr/debian buster InRelease
Get:6 http://archive.raspberrypi.org/debian buster/main armhf Packages [393 kB]
Get:7 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Reading package lists... Done
E: Failed to fetch https://dl.bintray.com/openhab/apt-repo2/dists/stable/InRelease  403  Forbidden [IP: 34.212.193.227 443]
E: The repository 'https://dl.bintray.com/openhab/apt-repo2 stable InRelease' is no longer signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Error executing command, exiting

I don't seem to have a /etc/apt/sources file, might it be in another directory?

I found this in a file called /etc/apt/sources.list

deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

It will be a file in /etc/apt/sources.list.d, probably called openhab or something similar. You can remove that file or comment out the contents by adding # at the front of the line.

Thanks Colin.
I commented out the line. and reran the node script.

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -

## Installing the NodeSource Node.js 16.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 https://deb.nodesource.com/node_10.x buster InRelease
Get:2 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Hit:3 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:4 http://packages.azlux.fr/debian buster InRelease
Get:5 http://archive.raspberrypi.org/debian buster/main armhf Packages [393 kB]
Fetched 426 kB in 3s (168 kB/s)
Reading package lists... Done

## Confirming "buster" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_16.x/dists/buster/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
gpg: WARNING: unsafe ownership on homedir '/home/pi/.gnupg'

## Creating apt sources list file for the NodeSource Node.js 16.x repo...

+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x buster main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Get:1 https://deb.nodesource.com/node_16.x buster InRelease [4,584 B]
Hit:2 http://packages.azlux.fr/debian buster InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:5 https://deb.nodesource.com/node_16.x buster/main armhf Packages [779 B]
Fetched 5,363 B in 2s (3,030 B/s)
Reading package lists... Done

## Run `sudo apt-get install -y nodejs` to install Node.js 16.x and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn

pi@RPi3Bp:~ $ nodejs -v
v10.24.1

Should I now run ## Run sudo apt-get install -y nodejsto install Node.js 16.x and npm
Thanks!

Run the pi install script. The test was to prove that the error was generated by the nodesource command, not by the node red script directly.

1 Like

Thanks @Colin and @dceejay !
All is good!

Running Node-RED update for user pi at /home/pi on raspbian


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.1
  Install Node.js 16 LTS              ✔   v16.13.0   Npm 8.1.0
  Clean npm cache                     ✔
  Install Node-RED core               ✔   2.1.3
  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
All done.
You can now start Node-RED with the command  node-red-start
  or using the icon under   Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started :  Mon Nov  1 15:22:31 MDT 2021
Finished:  Mon Nov  1 15:25:28 MDT 2021
pi@RPi3Bp:~ $ nodejs -v
-bash: /usr/bin/nodejs: No such file or directory
pi@RPi3Bp:~ $ npm -v
8.1.0
pi@RPi3Bp:~ $ apt-cache policy nodejs
nodejs:
  Installed: 16.13.0-deb-1nodesource1
  Candidate: 16.13.0-deb-1nodesource1
  Version table:
 *** 16.13.0-deb-1nodesource1 500
        500 https://deb.nodesource.com/node_16.x buster/main armhf Packages
        100 /var/lib/dpkg/status
     10.24.0~dfsg-1~deb10u1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
1 Like

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