Cannot install nodes via palette manager

Lately I am not able to install any new nodes via palette manager, see below error.
I was trying to install node-red-contrib-blynk-iot

I completely rebuilt my Pi4 installation, and restored my node red files (running in Docker). So assuming the error is within my config somewhere.
Any pointers please?

2022-11-04T21:34:36.156Z Install : node-red-contrib-blynk-iot 0.2.0

2022-11-04T21:34:35.573Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-blynk-iot@0.2.0
2022-11-04T21:34:36.964Z [err] npm
2022-11-04T21:34:36.965Z [err]  WARN config production Use `--omit=dev` instead.
2022-11-04T21:34:41.129Z [err] npm
2022-11-04T21:34:41.130Z [err]  ERR! code ENOTEMPTY
2022-11-04T21:34:41.131Z [err] npm ERR! syscall rename
2022-11-04T21:34:41.132Z [err] npm ERR!
2022-11-04T21:34:41.133Z [err]  path /data/node_modules/node-red-node-email
2022-11-04T21:34:41.133Z [err] npm ERR! dest /data/node_modules/.node-red-node-email-ZF9YCqdF
2022-11-04T21:34:41.134Z [err] npm ERR! errno -39
2022-11-04T21:34:41.138Z [err] npm ERR! ENOTEMPTY: directory not empty, rename '/data/node_modules/node-red-node-email' -> '/data/node_modules/.node-red-node-email-ZF9YCqdF'
2022-11-04T21:34:41.142Z [err] 
2022-11-04T21:34:41.143Z [err] npm ERR! A complete log of this run can be found in:
2022-11-04T21:34:41.143Z [err] npm ERR!     /data/.npm/_logs/2022-11-04T21_34_36_864Z-debug-0.log
2022-11-04T21:34:41.166Z rc=217

This is an issue that has appeared occasionally recently, it is not clear what triggers it. If you delete that folder then you should be ok. If it complains about any other similarly named folders (with the random chars on the end) then delete them too.

It appears to be some oddity with recent versions of npm. I've seen it a number of times.

If you ever get stuck with node installs. There are a couple of things you can do. Firstly delete the package lock file in your userDir folder (typically ~/.node-red). Then, somewhat drastically, delete the node_modules folder from the same folder. Finally do npm install again from the same folder. That will give you a clean install of all nodes and their dependencies.

1 Like

And, since the package lock file has been deleted, it will upgrade all nodes to the latest versions, which may or may not be what you want.

1 Like

I first renamed package-lock.json to package-lock.json.BAK , then I deleted the .node-red-node-email-ZF9YCqdF dir and restarted node red, but it came back to haunt me:

2022-11-05T08:25:23.434Z Install : node-red-contrib-blynk-iot 0.2.0

2022-11-05T08:25:23.447Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-blynk-iot@0.2.0
2022-11-05T08:25:24.972Z [err] npm
2022-11-05T08:25:24.974Z [err]  
2022-11-05T08:25:24.975Z [err] WARN
2022-11-05T08:25:24.976Z [err]  
2022-11-05T08:25:24.976Z [err] config
2022-11-05T08:25:24.977Z [err]  production Use `--omit=dev` instead.
2022-11-05T08:25:33.942Z [err] npm
2022-11-05T08:25:33.943Z [err]  ERR! 
2022-11-05T08:25:33.944Z [err] code ENOTEMPTY
2022-11-05T08:25:33.944Z [err] npm ERR! syscall rename
2022-11-05T08:25:33.945Z [err] npm ERR! path /data/node_modules/node-red-node-email/node_modules/commander/typings
2022-11-05T08:25:33.945Z [err] npm ERR!
2022-11-05T08:25:33.946Z [err]  dest /data/node_modules/.node-red-node-email-ZF9YCqdF/node_modules/commander/typings
2022-11-05T08:25:33.947Z [err] npm ERR! errno -39
2022-11-05T08:25:33.951Z [err] npm ERR! ENOTEMPTY: directory not empty, rename '/data/node_modules/node-red-node-email/node_modules/commander/typings' -> '/data/node_modules/.node-red-node-email-ZF9YCqdF/node_modules/commander/typings'
2022-11-05T08:25:33.958Z [err] 
2022-11-05T08:25:33.960Z [err] npm ERR! A complete log of this run can be found in:
2022-11-05T08:25:33.960Z [err] npm ERR!     /data/.npm/_logs/2022-11-05T08_25_24_869Z-debug-0.log
2022-11-05T08:25:34.003Z rc=217

So I deleted /data/node_modules/node-red-node-email dir and again restarted node red, and found the originally requested node node-red-contrib-blynk-iot was already installed. And I am now able to update other nodes where I could not before.

The node still shows in palette manager as available and updatable, not sure if I should delete, update or ignore!

image

Will update if anything new happens. Thanks guys!

npm has probably fully the installed it again, as it is in your package.json file. If you don't need a node there is no point leaving it installed, so you might as well remove it.

Yes agreed, thank you!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.