I am on NR 4.0.9 but somehow still on Node.js v18.19.0.
I want to play around with Meshtastic and wanted to use @danpeig/node-red-meshtastic-msg, but it required Node.js v20.
So far I only used the upgrade script to keep Node-Red up-to-date, and I probably did not check which node version it was upgrading to.
But wanted to ask before I break anything. Which version I should be on? What is the eaiest way to upgrade now?
You can upgrade nodejs using the upgrade script. Just add to the end (after a space) --node20 to get nodejs 20. In fact I suggest using 22, so --node22 unless the node you are trying to use requires exactly 20.
When you run the script without explicitly specifying the nodejs version it just checks that a valid version is installed, and 18 is ok for the current version of node-red.
Really, Node-RED should be clear. v18 is the MINIMUM version of Node.js for Node-RED v4. You should always be using one of the current LTS versions.
Though occasionally a cutting-edge version might cause a few issues. So the general recommendation is to be on an EVEN-NUMBERED, "CURRENT" LTS version.
Odd numbered versions should never be used as they may contain breaking experiments. v22 ("Jod") is the Current LTS version right now.
Actually their nomenclature is a bit confusing confusing. The LTS version at the moment is 22, but the Current version is 24, but it isn't the LTS version yet. At least that is my interpretation of Node.js — Node.js Releases
Edit: Reading it again, I think the correct terminology is Active LTS (which is 22 at the moment). 20 is a Maintenance LTS and 18 was a Maintenance LTS but has just gone End Of Life.