Update issues with NR 4.1.1

Having updated to NR 4.1.1 on a debian bullseye pi machine and trying to remove a note in the pallet manager I get the following error:

2025-10-21T21:31:44.596Z remove: node-red-contrib-enocean
2025-10-21T21:31:43.613Z npm remove --no-audit --no-update-notifier --no-fund --save node-red-contrib-enocean
2025-10-21T21:31:48.277Z [err] npm error code ENOTEMPTY
2025-10-21T21:31:48.278Z [err] npm error syscall rename
2025-10-21T21:31:48.279Z [err] npm error path /home/pi/.node-red/node_modules/esm
2025-10-21T21:31:48.282Z [err] npm error dest /home/pi/.node-red/node_modules/.esm-muDamFlX
2025-10-21T21:31:48.282Z [err] npm error errno -39
2025-10-21T21:31:48.286Z [err] npm error ENOTEMPTY: directory not empty, rename '/home/pi/.node-red/node_modules/esm' -> '/home/pi/.node-red/node_modules/.esm-muDamFlX'
2025-10-21T21:31:48.296Z [err] npm error A complete log of this run can be found in: /home/pi/.npm/_logs/2025-10-21T21_31_44_232Z-debug-0.log
2025-10-21T21:31:48.349Z rc=217

Trying to install @flowfuse/node-red-dashboard 1.29.0 I get the following error:

2025-10-21T21:33:31.901Z install: @flowfuse/node-red-dashboard 1.29.0
2025-10-21T21:33:30.875Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict @flowfuse/node-red-dashboard@1.29.0
2025-10-21T21:33:43.031Z [err] npm error code ENOTEMPTY
2025-10-21T21:33:43.032Z [err] npm error syscall rename
2025-10-21T21:33:43.032Z [err] npm error path /home/pi/.node-red/node_modules/undici
2025-10-21T21:33:43.034Z [err] npm error dest /home/pi/.node-red/node_modules/.undici-pZNij1KU
2025-10-21T21:33:43.035Z [err] npm error errno -39
2025-10-21T21:33:43.036Z [err] npm error ENOTEMPTY: directory not empty, rename '/home/pi/.node-red/node_modules/undici' -> '/home/pi/.node-red/node_modules/.undici-pZNij1KU'
2025-10-21T21:33:43.046Z [err] npm error A complete log of this run can be found in: /home/pi/.npm/_logs/2025-10-21T21_33_31_544Z-debug-0.log
2025-10-21T21:33:43.076Z rc=217

Node V 22.21.0
Nodejs V 20.19.1
nmp V 10.9.4
nvm V 0.40.3

last update which started ok
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --confirm-root --confirm-install --confirm-pi --restart --allow-low-ports --update-nodes

However this create startup issues and would not run NR anymore
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --confirm-root --confirm-install --confirm-pi --restart --allow-low-ports --update-nodes --node22

Any help or recommendations, thank you?

Try deleting these directories -

Thank you very much for this super fast reply and support.

I was able to delete the .undici-pZNij1KU directory and the .esm-muDamFlX.

It looks like that node-red-contrib-enocean has been removed from the pallet manager.

However, trying to install @flowfuse/node-red-dashboard 1.29.0 via the pallet manager gives me now the following error

2025-10-22T03:05:07.457Z Install : @flowfuse/node-red-dashboard 1.29.0

2025-10-22T03:05:06.731Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict @flowfuse/node-red-dashboard@1.29.0
2025-10-22T03:05:49.033Z [err] npm error code EACCES
2025-10-22T03:05:49.034Z [err] npm error syscall open
2025-10-22T03:05:49.035Z [err] npm error path /home/pi/.node-red/package.json
2025-10-22T03:05:49.036Z [err] npm error errno -13
2025-10-22T03:05:49.045Z [err] npm error Error: EACCES: permission denied, open '/home/pi/.node-red/package.json'
2025-10-22T03:05:49.045Z [err] npm error     at async open (node:internal/fs/promises:639:25)
2025-10-22T03:05:49.045Z [err] npm error     at async writeFile (node:internal/fs/promises:1216:14)
2025-10-22T03:05:49.045Z [err] npm error     at async PackageJson.save (/usr/lib/node_modules/npm/node_modules/@npmcli/package-json/lib/index.js:259:23)
2025-10-22T03:05:49.045Z [err] npm error     at async [saveIdealTree] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:1528:9)
2025-10-22T03:05:49.045Z [err] npm error     at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:134:5)
2025-10-22T03:05:49.045Z [err] npm error     at async Install.exec (/usr/lib/node_modules/npm/lib/commands/install.js:150:5)
2025-10-22T03:05:49.045Z [err] npm error     at async Npm.exec (/usr/lib/node_modules/npm/lib/npm.js:208:9)
2025-10-22T03:05:49.045Z [err] npm error     at async module.exports (/usr/lib/node_modules/npm/lib/cli/entry.js:67:5) {
2025-10-22T03:05:49.045Z [err] npm error   errno: -13,
2025-10-22T03:05:49.045Z [err] npm error   code: 'EACCES',
2025-10-22T03:05:49.045Z [err] npm error   syscall: 'open',
2025-10-22T03:05:49.045Z [err] npm error   path: '/home/pi/.node-red/package.json'
2025-10-22T03:05:49.045Z [err] npm error }
2025-10-22T03:05:49.053Z [err] npm error
2025-10-22T03:05:49.053Z [err] npm error The operation was rejected by your operating system.
2025-10-22T03:05:49.053Z [err] npm error It is likely you do not have the permissions to access this file as the current user
2025-10-22T03:05:49.053Z [err] npm error
2025-10-22T03:05:49.053Z [err] npm error If you believe this might be a permissions issue, please double-check the
2025-10-22T03:05:49.053Z [err] npm error permissions of the file and its containing directories, or try running
2025-10-22T03:05:49.053Z [err] npm error the command again as root/Administrator.
2025-10-22T03:05:49.072Z [err] npm error A complete log of this run can be found in: /home/pi/.npm/_logs/2025-10-22T03_05_07_343Z-debug-0.log
2025-10-22T03:05:49.115Z rc=243

For some unknown reason this seems to be now a permission issue.
How do I need to proceed to install @flowfuse/node-red-dashboard 1.29.0 properly and also future notes without any issues?

It looks as if you have used sudo (root) to do something in the .node-red directory so have ended up with the node red user unable to update the files.

You can probably fix it by restoring ownership by logging on as the user pi and running
sudo chown -R pi:pi ~/.node-red

Yes, Colin you are right. I found a few files in ~/.node-red with root ownership.

This must have happened some times to end last year when I had NR update issues.

Whenever I tried to update with your script:

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --confirm-root --confirm-install --confirm-pi --restart --allow-low-ports --update-nodes --node22

NR would then not start anymore, so I always moved back to run the update without the option --node22. May be the update issue has always been related to the ownership after all.

Finally I was able to remove some old or not required notes and NR now starts again without any issue:

22 Oct 09:19:08 - [info] Node-RED version: v4.1.1
22 Oct 09:19:08 - [info] Node.js version: v20.19.1
22 Oct 09:19:08 - [info] Linux 5.10.103-v7l+ arm LE
22 Oct 09:19:09 - [info] Loading palette nodes
22 Oct 09:19:13 - [info] Dashboard version 3.6.6 started at /ui

Anyhow guys thanks again for all your support.
Let's see how far I get till I'm stuck again.

Why have you got --confirm-root in your options? You should not run the install script as root.

Can you explain your reason for picking each of that long list of flags, especially --confirm-root and --allow_low_ports?

Edit: snap!

Thank you for indicating these aspects and making your points. Since this goes a long way back when I started with NR, at some point I never questioned again my setting. I assumed I made the right choices. Anyhow thanks again for your support.