Installing and Upgrading Node-RED help needed

Hi Y'all!

I am trying to update my node red installation using the script - Runs no problem....BUT....

I would like to install a later version of nodejs, hence me "poking the bear"...

The install script installs nodejs version "node":"v22.15.0","npm":"11.19.1"

Telegram bot needs "node":">=22.19.0"

There is an update to v22, it is v22.23.3 which the telegram node should be able to use...

I have tried to do the update script with --node24 and with --node23 but my pi is only on Bullseye/11 and from what I can determine, this is a bit out of date for nodejs 23 or 24...

I have managed to install V22.23.3 and set it to default but cannot get node-red to use it...

I am not keen on doing an OS upgrade at the moment if at all possible...

Any pointers as to getting it rolling?

TIA
Ed

[Edit], before running the commands below, run sudo apt update

What do the commands
apt policy nodejs
which node
and
node -v
show?

nodejs:
  Installed: 22.15.0-1nodesource1
  Candidate: 22.15.0-1nodesource1
  Version table:
 *** 22.15.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
        100 /var/lib/dpkg/status
     22.14.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.13.1-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.13.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.12.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.11.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.10.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.9.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.8.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.7.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.6.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.5.1-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.5.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.4.1-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.4.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.3.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.2.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.1.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.0.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     12.22.12~dfsg-1~deb11u8 500
        500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages
which node
/home/pi/.config/nvm/versions/node/v22.23.3/bin/node
node -v
v22.23.3
And for good measure, the log of the failed telegrambot install:
2026-09-28T13:33:55.947Z Install : node-red-contrib-telegrambot 19.0.3



2026-09-28T13:33:55.985Z /usr/bin/node /usr/lib/node_modules/node-red/node_modules/npm/bin/npm-cli.js install --no-audit --no-update-notifier --no-fund --save --save-prefix=\~ --omit=dev --engine-strict -- node-red-contrib-telegrambot@19.0.3

2026-09-28T13:34:00.513Z \[err\] npm error code EBADENGINE

2026-09-28T13:34:00.513Z \[err\] npm error engine Unsupported engine

2026-09-28T13:34:00.513Z \[err\] npm error engine Not compatible with your version of node/npm: node-red-contrib-telegrambot@19.0.3

2026-09-28T13:34:00.517Z \[err\] npm error notsup Not compatible with your version of node/npm: node-red-contrib-telegrambot@19.0.3

2026-09-28T13:34:00.517Z \[err\] npm error notsup Required: {"node":">=22.19.0"}

2026-09-28T13:34:00.517Z \[err\] npm error notsup Actual:   {"node":"v22.15.0","npm":"11.19.1"}

2026-09-28T13:34:00.524Z \[err\] npm error A complete log of this run can be found in: /home/pi/.npm/\_logs/2026-09-28T13_33_56_732Z-debug-0.log

2026-09-28T13:34:00.543Z rc=1

Ed

Did you run sudo apt update first?

The reason it is not finding the nodejs install is because you have installed it using nvm, which, for the purposes of use with node-red, is generally not a good idea.

I have run apt update.

I have also uninstalled via system and then reinstalled/refreshed via the node red script. This installs nodejs v22.15.0 - Telegrambot needs >=22.19.0.

This was a try with v22.23 installed via nvm if I remember correctly...

Ed

Was that before the apt policy command. I thought that 22.23 was available for armhf on nodesource.

here it is again...

sudo apt update
Hit:1 https://deb.nodesource.com/node_22.x nodistro InRelease                                              
Get:2 https://repos.influxdata.com/debian stable InRelease [6,922 B]                                       
Hit:3 http://raspbian.raspberrypi.org/raspbian bullseye InRelease                                          
Get:4 http://archive.raspberrypi.org/debian bullseye InRelease [39.0 kB]                                   
Hit:5 https://apt.grafana.com stable InRelease                                                             
Hit:6 https://download.webmin.com/download/newkey/repository stable InRelease                              
Get:7 http://archive.raspberrypi.org/debian bullseye/main armhf Packages [330 kB]
Fetched 376 kB in 3s (117 kB/s)   
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
pi@InvPi2:~ $ apt policy nodejs
nodejs:
  Installed: 22.15.0-1nodesource1
  Candidate: 22.15.0-1nodesource1
  Version table:
 *** 22.15.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
        100 /var/lib/dpkg/status
     22.14.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.13.1-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.13.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.12.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.11.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.10.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.9.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.8.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.7.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.6.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.5.1-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.5.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.4.1-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.4.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.3.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.2.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.1.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     22.0.0-1nodesource1 500
        500 https://deb.nodesource.com/node_22.x nodistro/main armhf Packages
     12.22.12~dfsg-1~deb11u8 500
        500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages

Ed

You are right, only 22.15 is available.

I don't know how to make node-red use the nvm install, sorry.

How are you running Node-RED ? If you are trying to run it as a service it won’t pick up the nvm version of node. If you just run node-red from the command line it should pick up the one that node -v reports. (But then you can’t close that window etc)

Hi @dceejay,

I am running it as a service - it is on a dedicated pi with grafana and a few utils for my home auto...

TIA
Ed

The easiest solution may be to stick with the earlier nodejs and install an earlier version of the telegram node (18.1.1)

@Colin I have a functioning Telegrambot active... there is an update for it which I would like to use to keep my system fully up to date...

Could or would it be an an idea to update to V24 using the --node24 option?

@mudwalker .... tried that....needs a ??C library?? version only available for later versions of OS...

As I understand it, nodejs 24 is only for 64 bit OS. @eddee54455 would have to upgrade the OS to a 64 bit version.

Did you try asking AI how to use the nvm version of nodejs in the systemd script?

@Colin

pi@InvPi2:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@InvPi2:~ $ uname -m
aarch64

It is a 64bit...

Apologies, missed that at the top!

I must admit that I vaguely remember the same problem when trying to update one of my RPi's, so this might come along and bite me too as I use Telegrambot as well.

EDIT: I think I now recall which RPi, I will try to see what happens going through the same loops. I only use the script on the bare system though.

Just checked, the system is on Bookworm Release.

Memories slowly coming back, I had to update from Bullseye so that I could install Node24 for Telegram. I did keep my fingers crossed as I did the OS update, but all went well. (RPi4 with external USB Disk Drive.)

I am running nodejs 24 on a pi with bullseye, which shows exactly the same for os-release and uname -m. What sort of pi is it?

Also what is in the file /etc/apt/sources.list.d/nodesource.list