You almost certainly have a node.js version manager such as n or nvm installed. This is a pain for most people and even though node.js are trying to push people towards it, it is totally unnecessary in most cases.
The problem being that every time you use one of those tools to change node.js version, any globally installed nodes have to be re-installed. This is also one of several reasons I donāt personally recommend that people do a global install of node-red.
But anyway, you are probably best off removing the version manager from your OS. If that breaks Node-RED, simply re-install it. You will not loose any data/config unless you also delete Node-REDās userDir (normally ~/.node-red/ for the user id running node-red).
OS upgrades :
sudo apt update
NR : installed cfr instruction on NR site :
sudo npm install -g --unsafe-perm node-red
node.js installed with
npm install -g pnpm
node -v -> v22.9.0, which is a requirement for major upgrade ZigBee2MQTT... which failed so far.
I am in chat-process with AI-platforms for the proper and advised procedure. And again... 3 different approaches.
as i installed both with "npm -g", why then is NR reporting "Node.js version: v18.20.8" ?
In the end it's not so important as "I'm completely operational, and all my circuits are functioning perfectly."
As a newbee in RPI/LINUX... i work now with NR (with context on SSD), AEDES, ESP32, modbus, VPN, MariaDB, UZG-01 (coƶrdinator) and ZigBee2MQTT.
And UI : standard web page and socket.
All the operational was surprisingly "straight forward" to work with... except the confusing multiple wow how to install.
They say we fly to mars ! Hope they do not work with linux. pfffffffffffff
As already mentioned, you are likely using a Node Version Manager like n or nvm or fnm. Running the command which node should give us a clue.
The version of Node that node-red runs under depends entirely on what you did in the beginning (i.e. which node manager you installed. Again, running the command which node should give us a clue)
NOTE: The recommended install is to NOT install a node manager especially if you are running as a service and dont really quite understand what that means. Far better sticking with a global install of Node
As it stands, your options are:
learn about node version manager you have installed and set it to use Node 22 for the account/userdir that Node-RED runs in
remove node manager and rely on globally installed node version
As for installation, if you are using a debian based OS (like Debian, unbuntu, raspian, etc), then the recommended install is via the official installer script.
FYI : next step was major version 2.5.1 upgrade of Zigbee2MQTT. Previous attempt failed, but now also solved after re-install/clean-up node.js
Z2M config required to adjust setting to AEDES-server, and serial adapter now set to zstack and removed baudrate.
Z2M service required no adjust
Node-Red : node-red-contrib-zigbee2mqtt no issue
"I'm completely operational, and all my circuits are functioning perfectly.", but need to be 70+ to know where this quote comes from.
Hal said : "I am completely operational, and all my circuits are I am completely operational, and all my circuits are functioning perfectly.. functioning perfectly."
Another much bigger pain is when the version of your operating system is too old. Like yesterday when I upgraded a RPi4 and it did not succeed to update node.js to a later version than 18.
The os on that thing is really old, Raspbian Buster. Node 18 is the latest you can install on it. Upgrading the os to a later version is possible but requires a lot of effort, the amount depending on what you have installed on the thing and I have unfortunately a lot, besides being a bit lazy with such stuff. This also means I will sooner or later run into situations where upgrading of some nodes will not work due to their requirements
Iām in the same situation, as I still use a RPi3B+ with Buster. You can install NodeJS version 18, but donāt try 20 or later. Due to the Glibc issue. I can confirm, that NR v4.1.0 runs on a RPi1B+, but with Bookworm.
So I have to update my Pi 3B to a newer version, sooner or later.
In most cases you can āmanuallyā upgrade the OS level without issue - it just takes a long time⦠- you can do a full upgrade to latest patches on the level you are at currently - then manually edit the /etc/apt/sources.list and /etc/apt/sources.list.d/* files to point to the next level up OS - then sudo apt install and full upgrade that⦠- then repeat until you are on the latest levelā¦
Normally there is also a do-release-upgradecommand installed that will do the same thing for you.
But as I said it can take a while - like 2-3 hoursā¦