Node red problem, cant update or install palette(s)

Hi everyone,

I wanted to install al palette a while ago, and I got a error message, same goes for updating a palette.

and logs show this.

I restarted node red, but that didnt help.

Can anyone tell me how i can fix this?

(the pics above are example, I get this with every update or installation)

I am no Node Red expert but this error:

npm error notsup Required: {"node" :"10 | | 12 | | 14 | | 16 | | 18"}
npm error notsup Actual: {"npm":"10.9.l","node":"v22.ll.0"}

The required Node.js versions are 10, 12, 14, 16, or 18, but your current version is 22.11.0.

I would try opening the Node-Red add-on and see if there is an update available there.

The Home Assistant Node-RED add-on, recently updated to v19, has moved to node.js v22+ as the base JS engine.

The main Node-RED nodes will support this version, but some contribution nodes will not. In particular @azure/msal-node has been seen to generate this error recently. For some reason something has included a very old version of msal-node which has dependency on the node.js engine as “10 || 12 || 14 || 16 || 18”, rather than something like “>=10”.

This means that, since the installed node.js is now v22 (and also for anyone with v20) npm will not install the node, or will now fall over when trying to update around the node.

Currently msal-node is at version 3.1.0, so 1.18.3 is very old.

So, you must have @azure/msal-node installed in your node_modules directory, and this needs updating. I don’t know but I think that this is not a contrib node but rather a support library that something else has ‘required’.

To find out what module depends on this (ie what got it into your node_modules directory in the first place) you need to run,from the .node-red user directory,

npm list

or

npm list @azure/msal-node

to list dependencies .

Fortunately it seems the NR as an add-on already runs in this directory, hence add an exec node to a flow (with inject and debug) and use the command as follows;

Then all you have to do is go through the result and look for @azure and see what depends on it…

EDIT.
Well, that took some digging.

So, there is a contrib node node-red-contrib-msal, which is over four years since last worked on (see GitHub repository).

And, inside this is the package.json file

And, inside that is the line

  "dependencies": {
    "@azure/msal-node": "^1.0.1"

which is saying - I need @azure/msal-node, from version 1.0.1.

And, the ^ says “only this major release”, hence anything from 1.0.1 to 1.18.3 (which is probably the very last v1+ before v2 came in).

So, an answer for the brave is to edit this line to

^2.0.1 (which will bring in the last version in v2+ which should support node.js v22)

but of course I have no idea if this will work, so clearly I cannot recommend it.

@stevemann @Biscuit Thank you for the reply, i am going to have a look at it.

dè definitely keep you updated :+1:

I made the flow as sugested and it gave this message

Well that is exactly what I have on my recently updated machine, and nothing to indicate that @azure/msal-node is in your system. I can only suggest that you look in the node module folder (addon_configs > a0d7b954_nodered > node_modules) to see if @azure (and/or node-red-contrib-msal) is there.

1 Like