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...
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
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 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...
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)
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.
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.)