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

I think i found it, perhaps noobisch question, what should i do now?

My gut tells me, that i need to install a new version, i am googling and NPM keeps getting mentioned, do i need some kind of program is install a newer version?

I have been comparing HAss with that of a friend of my, allthough his system hasnt got as much integrations as my system, his does not show “addons_config” in studio code server.

the addon config, what relation of connection does this have within HA? I know its a bit crud… but cant i just delete it, or a piece of the code?

His system is on the same versions as i do, and he does nog have the problem(s) i have.

Home assistant is different depending on how it is set up. Fully supervised, the supervisor runs in a docker container and HA and all add-ons run in separate containers.

With Samba share, at the top level entry you can see HA holds everything in separate directories.

/config holds the HA config

/addon_config holds each addon config in a separate folder. Node-RED is in a0d7b954_nodered

Under no circumstances whatsoever should you remove any HA folder. No, don’t, never, don’t even think about it.

[I am sure that someone will have a valid reason for deleting /addon_config]

Comparing systems is a good way to isolate differences but not finding /addon_config is his problem not yours

You must have the problematic @azure/msal_node for some reason

See:

https://github.com/node-red/node-red-dashboard/issues/839

Run the exec command

npm list @azure/msal-node

to find out what depends on this problem module, then update or remove that.

1 Like

thank you Geoff, i will have a look at it…

Thank you in advance for the help

Any progress on this item?
I’m running into the same problem on all nodes i would like to update.

There is an update on node node-red-contrib-home-assistant-websocket but i can’t because of this error:

2025-04-11T09:58:16.879Z Install : node-red-contrib-home-assistant-websocket 0.75.0

2025-04-11T09:58:16.940Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict [email protected]
2025-04-11T09:58:27.189Z [err] npm error code EBADENGINE
2025-04-11T09:58:27.190Z [err] npm error engine Unsupported engine
2025-04-11T09:58:27.190Z [err] npm error engine Not compatible with your version of node/npm: @azure/[email protected]
2025-04-11T09:58:27.191Z [err] npm error notsup Not compatible with your version of node/npm: @azure/[email protected]
2025-04-11T09:58:27.191Z [err] npm error notsup Required: {"node":"10 || 12 || 14 || 16 || 18"}
2025-04-11T09:58:27.191Z [err] npm error notsup Actual:   {"npm":"10.9.1","node":"v22.13.1"}
2025-04-11T09:58:27.199Z [err] npm error A complete log of this run can be found in: /root/.npm/_logs/2025-04-11T09_58_17_254Z-debug-0.log
2025-04-11T09:58:27.234Z rc=1

Running the exec commands also gives an error: Command failed: npm list @azure/msal-node

I want to update the node-red-contrib-home-assistant-websocket because my injects stop working so now and then. Someone on this forum suggested to update.

1 Like

Nothing is going to change. You have to fix this problem yourself.

It is most likely that you have the old version (1.12.1) of @azure/msal-node installed, or something (custom node) that requires this as a dependency. This old version (now very much out of date) demands the node.js engine up to 18, and we are now on 22. As soon as you install node.js version 20 or above, npm will reject any update attempt.

Critically, the problem is that @azure/msal-node at v1.12.1 requires the node.js as version 10 or 12 or 14 or 16 or 18. Hence nothing less than 10 and nothing greater than 18.

As far as I know, the one and only solution is to find the @azure/msal-node and either update it, or remove it. You have to do this yourself.

Addendum:

@azure/msal-node is probably not directly loaded for itself, but is a dependency called by other @azure nodes. The root issue appears to lie with Microsoft libraries. I don’t have this issue myself, so I can’t help you further, however I note that

npm ls azurite

has been noted to generate

└─┬ [email protected]
  └─┬ [email protected]
    └─┬ @azure/[email protected]
      └── @azure/[email protected]

which is the dependency tree that you are hunting for and ultimately shows where and why msal-node is pulled in.

In the above case, there will be a node in the node module folder for something like ‘azurite’ and this needs to be updated or removed.

I guess that the only way of finding the problem definitively is to list all suspect node in the node module folder, and then run npm ls <node> on each one. You can probably narrow this down to just a few contrib nodes that you have added yourself.

Thats a pity!

I will try to locate the package that holds it from updating.
Already tried to update the package manually but without success.

Do you have an idea how to get into the terminal of nodered integration? Using exec every time is not going to help.

I don’t have your issue, but if I did I would probably look to backing up my Node-RED flow file, removing Node-RED completely, re-installing a fresh copy and re-loading the flow file, and then working out what nodes were missing and probably not re-installing (all of) them.

Other options are rather limited. If you are running Node-RED independently, as I do on something like a Raspberry Pi, then Node-RED is run as a service, and you can use the machine CLI to run things like npm, as well as updating the various packages and editing the full Node-RED settings file.

However, if you are running Node-RED as a Home Assistant add-on, then this is likely to be run in a separate docker container under the control of the HA supervisor. Since the NR add-on comes with only the executable code and a cut-down settings file, there is not much you can do other than start it and stop it from the HA supervisor (unless someone knows better - anyone???).

As NR is run as a service, there is no CLI or terminal. If you look at the add-on configuration you will see, under configuration, system-packages, npm_packages, and init_commands. That is all you get by way of ‘terminal’.

If you Samba into HA and go to the /addon_configs/a0d7b954_nodered folder you can access the package.json file for the dependencies, and see the node modules in the node_modules folder to see if you can track down an extra node around the azurite / tedious / @azure list.

Of course, someone else may know better than I…

Oh, and if you do find the answer, I am sure that many others would appreciate hearing back from you as to how you managed to fix this one. I am not sure that anyone has actually found an answer yet.

By default users are locked out of the main system terminal but there are a few way to get in.

First way is to enable port 22222. ssh’ing into this port will give you the system terminal. From there you can navigate to the NR container.

Second way is to use this version of portainer. With that you can go through the gui to the container and open a terminal.

Note: to the OP his is going to give you full access to the system, changes you make from there can result in an unrecoverable instance. Only proceed if you are sure you know what you are doing and make a backup JIC.

E. Also it’s probably best not to remove nodes from the command line, use the palette manger instead.

1 Like

I am very glad that you know all this stuff!

Not sure that I want to try testing this, but I assume this approach allows access to Node-RED add-on, and that npm uninstall <name> will run from the command line, even with dependency issues (ie npm only checks dependencies on install/update).

This just leaves the OP to find the problem node, remove it, then re-install a newer version (assuming one exists) that does not have the ultimate dependency on node.js v18.

I am at a point that i need to wait for a few days off to have a go at it, sinds my home in some way depends on HAss. When the system doesnt work, i can just let is wait untill i have free time.

What i did so far, i deleted the “addon_config” folder… in studio code server, but that didnt help.

Beginning of may i have 2 days off, its my intention to delete node red en reinstall it, import my flows and hope that will do the trick… if that doesn’t help… i am concidering installing HAss from scratch.

Good option! I know portainer so i will give this a go.

Portainer does not start so i need to try another method. Come back to you later.