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.

Hi Beno,

I have deployed my node-red flows onto a IOT2050 device, but there is missing nodes i am trying to install. Does the device have to access to the internet in order to download these missing nodes, or can i import them somehow from my host?
Thanks

I am not familiar with the Siemens IOT2050, but I assume that you need a Internet connection to install custom nodes.

With Opto 22 groov RIO or EPIC Systems, there are ways to offline get the custom Nodes installed in Node-RED. The groov Manage configuration tool has the functionality to restore flows with all custom nodes that are used on a new device.

All the way to the bottom of this post thread - review the last two posts:

Both the EPIC (or RIO) and the computer that you have the Node-RED editor open on MUST have a valid gateway to the internet to be able to install any nodes and their dependencies.
Installing from the host is not really an option for a few reasons.
Best way is to install via internet.
Next best way is as Gerhard pointed out, install the node on a groov of the same time and firmware level that does have internet access, then back up the Node-RED project and move that backup to the off-line groov and restore it.

I have this error while trying to install the serial nodes on groov rio, and i cant figure out a reason why this is happening as i was able to already install some other nodes

The reason is highlighted here.
This is a known issue that is covered many times in the forums.
The serial port node required version of nodejs has changed, so you must install an older version (that works just fine).

I see you ask the same question on another thread, so will leave this here for others in future.

1 Like