Npm error, cant install any nodes

Excuse the newbie question but I’m running into an issue installing nodes. Heres the log -

2020-10-14T14:31:31.284Z Install : node-red-contrib-persist 1.1.1
2020-10-14T14:48:01.186Z npm install --no-audit --no-update-notifier --save --save-prefix=“~” --production node-red-contrib-persist@1.1.1
2020-10-14T14:48:36.546Z [err] npm
2020-10-14T14:48:36.548Z [err]
2020-10-14T14:48:36.550Z [err] ERR!
2020-10-14T14:48:36.552Z [err]
2020-10-14T14:48:36.553Z [err] path
2020-10-14T14:48:36.555Z [err] /home/dev/.node-red/node_modules/function-plot
2020-10-14T14:48:36.558Z [err] npm
2020-10-14T14:48:36.559Z [err]
2020-10-14T14:48:36.562Z [err] ERR!
2020-10-14T14:48:36.563Z [err]
2020-10-14T14:48:36.569Z [err] code EISGIT
2020-10-14T14:48:36.576Z [err] npm
2020-10-14T14:48:36.577Z [err]
2020-10-14T14:48:36.579Z [err] ERR!
2020-10-14T14:48:36.580Z [err]
2020-10-14T14:48:36.583Z [err] git
2020-10-14T14:48:36.584Z [err] /home/dev/.node-red/node_modules/function-plot: Appears to be a git repo or submodule.
2020-10-14T14:48:36.586Z [err] npm
2020-10-14T14:48:36.589Z [err] ERR! git /home/dev/.node-red/node_modules/function-plot
2020-10-14T14:48:36.590Z [err] npm
2020-10-14T14:48:36.592Z [err]
2020-10-14T14:48:36.597Z [err] ERR! git Refusing to remove it. Update manually,
2020-10-14T14:48:36.597Z [err] npm ERR! git or move it out of the way first.
2020-10-14T14:48:36.656Z [err]
2020-10-14T14:48:36.658Z [err] npm
2020-10-14T14:48:36.660Z [err]
2020-10-14T14:48:36.661Z [err] ERR!
2020-10-14T14:48:36.663Z [err] A complete log of this run can be found in:
2020-10-14T14:48:36.668Z [err] npm ERR! /home/dev/.npm/_logs/2020-10-14T14_48_36_620Z-debug.log
2020-10-14T14:48:36.711Z rc=1

When I first started playing with NR I was able to download a good handful of nodes, but at some point I started getting this error, the set up and network hasnt changed so I am drawing a blank. What can I do to fix this? Im running it on a Rio (2.0.1-b119), NR (v1.0.3), and js (v10.16.3)

Ok, well, that was a ‘fun’ 20 minutes… I have never seen that error before so did some Google Foo…

It seems that one of the Nodes you have installed in the past has a .git folder in it and should not have.
Node-RED is barffing on that .git folder.

The tricky bit now is how to fix it… The RIO does not have shell access and I am 97.3% sure that the exec command node is not going to have access to the /home/dev directory in order to remove that .git directory.

Best thing I think would be to backup all your flows separately and then update your RIO (2.0.2 had some important updates).
https://www.opto22.com/support/resources-tools/downloads/groov-rio-firmware
The update process will wipe clean your Node-RED directory and you can start installing your nodes again and hopefully not the broken one.

Ah that is a lot better news than I was expecting. I think I know which node is hiding the stubborn git (ha :wink: ) Ill update and see what where that leads. Thanks for the quick reply as always beno!

Hi Beno
I have the same issue. I updated the groov rio firmware. Still get “Failed” install message for any node-red module. Any troubleshooting suggestion will be appreciated.

I am 99% sure that if you check your log, you will see an error like reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
This means that your gateway or DNS is not set correctly so it cant resolve the node repo.

  1. Check your logs for errors like it says.
  2. Fix your network settings.

Let know if you get it sorted.