Node won't install, please help

I have tried to install widgetlord node so I can use a Pi-Spi 4-20ma current loop sensor to get data from a sensor, I followed instruction but getting this error..

Widgetlord instruction are at: Getting Started with PI-SPI Libraries – Widgetlords Electronics

Very new to node-red/raspberry pi, please help!

pi@raspberrypi:~ $ npm install node-red-contrib-widgetlords

ref-napi@1.4.1 install /home/pi/node_modules/ref-napi
node-gyp rebuild

Traceback (most recent call last):
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in
sys.exit(gyp.script_main())
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 545, in script_main
return main(sys.argv[1:])
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 538, in main
return gyp_main(args)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 514, in gyp_main
options.duplicate_basename_check)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 91, in Load
generator = import(generator_name, globals(), locals(), generator_name)
MemoryError
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.14.98-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/node_modules/ref-napi
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ref-napi@1.4.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ref-napi@1.4.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-06-04T11_36_52_643Z-debug.log

if you want to use the command line you need to be in your .node-red directory.

Much easier is to use the manage palette option under the menu in node-RED

Hi ukmoose

do you mean to:

"node-red-start"

Then type the same code?

"npm install node-red-contrib-widgetlords"

Sorry, just new and am stuck on this one step! I have played with and have had everything else running once I can get this node installed.

thanks

no

After you have started node red, go to the menu in node red and from the manage palette option you can install new nodes

Okay, this is the log it comes up with through the web dashboard in manage palette

"-----------------------------------------------------------
2019-06-04T21:42:42.599Z Install : node-red-contrib-widgetlords 1.1.0

2019-06-04T21:42:42.621Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-widgetlords@1.1.0
2019-06-04T21:42:54.436Z [err] npm
2019-06-04T21:42:54.437Z [err] ERR! path /home/pi/.node-red/node_modules/function-plot
2019-06-04T21:42:54.437Z [err] npm
2019-06-04T21:42:54.438Z [err] ERR! code
2019-06-04T21:42:54.438Z [err] EISGIT
2019-06-04T21:42:54.442Z [err] npm
2019-06-04T21:42:54.443Z [err] ERR! git /home/pi/.node-red/node_modules/function-plot: Appears to be a git repo or submodule.
2019-06-04T21:42:54.443Z [err] npm
2019-06-04T21:42:54.443Z [err] ERR! git
2019-06-04T21:42:54.443Z [err] /home/pi/.node-red/node_modules/function-plot
2019-06-04T21:42:54.443Z [err] npm
2019-06-04T21:42:54.444Z [err] ERR!
2019-06-04T21:42:54.444Z [err] git Refusing to remove it. Update manually,
2019-06-04T21:42:54.444Z [err] npm
2019-06-04T21:42:54.444Z [err] ERR!
2019-06-04T21:42:54.444Z [err] git or move it out of the way first.
2019-06-04T21:42:54.494Z [err]
2019-06-04T21:42:54.495Z [err] npm ERR! A complete log of this run can be found in:
2019-06-04T21:42:54.495Z [err] npm
2019-06-04T21:42:54.495Z [err] ERR! /home/pi/.npm/_logs/2019-06-04T21_42_54_453Z-debug.log
2019-06-04T21:42:54.514Z rc=1

Also, went through all the standard update/upgrades, ran again and:

2019-06-04T22:03:49.808Z Install : node-red-contrib-widgetlords 1.1.0

2019-06-04T22:03:49.836Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-widgetlords@1.1.0

2019-06-04T22:04:00.402Z [err] npm

2019-06-04T22:04:00.403Z [err] ERR! path /home/pi/.node-red/node_modules/function-plot

2019-06-04T22:04:00.403Z [err] npm ERR! code EISGIT

2019-06-04T22:04:00.407Z [err] npm

2019-06-04T22:04:00.408Z [err] ERR! git /home/pi/.node-red/node_modules/function-plot: Appears to be a git repo or submodule.

2019-06-04T22:04:00.408Z [err] npm

2019-06-04T22:04:00.408Z [err] ERR! git /home/pi/.node-red/node_modules/function-plot

2019-06-04T22:04:00.409Z [err] npm

2019-06-04T22:04:00.409Z [err] ERR! git Refusing to remove it. Update manually,

2019-06-04T22:04:00.409Z [err] npm ERR!

2019-06-04T22:04:00.409Z [err] git or move it out of the way first.

2019-06-04T22:04:01.417Z [err]

2019-06-04T22:04:01.418Z [err] npm ERR! A complete log of this run can be found in:

2019-06-04T22:04:01.418Z [err] npm ERR! /home/pi/.npm/_logs/2019-06-04T22_04_00_418Z-debug.log

2019-06-04T22:04:01.440Z rc=1

Remove it via commandline npm remove node-red-contrib-widgetlords
Then retry from gui.

I ran and got this error as removing via commanline:

npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'

npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'

npm WARN pi No description

npm WARN pi No repository field.

npm WARN pi No README data

npm WARN pi No license field.

audited 944 packages in 7.087s

found 0 vulnerabilities

Then tried in gui and got this:

2019-06-05T04:04:15.595Z Install : node-red-contrib-widgetlords 1.1.0

2019-06-05T04:04:15.697Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-widgetlords@1.1.0
2019-06-05T04:04:26.003Z [err] npm
2019-06-05T04:04:26.004Z [err] ERR! path /home/pi/.node-red/node_modules/function-plot
2019-06-05T04:04:26.005Z [err] npm
2019-06-05T04:04:26.005Z [err] ERR! code
2019-06-05T04:04:26.005Z [err] EISGIT
2019-06-05T04:04:26.009Z [err] npm
2019-06-05T04:04:26.010Z [err] ERR! git /home/pi/.node-red/node_modules/function-plot: Appears to be a git repo or submodule.
2019-06-05T04:04:26.010Z [err] npm
2019-06-05T04:04:26.010Z [err] ERR!
2019-06-05T04:04:26.010Z [err] git /home/pi/.node-red/node_modules/function-plot
2019-06-05T04:04:26.011Z [err] npm
2019-06-05T04:04:26.011Z [err] ERR! git
2019-06-05T04:04:26.011Z [err] Refusing to remove it. Update manually,
2019-06-05T04:04:26.011Z [err] npm
2019-06-05T04:04:26.011Z [err] ERR!
2019-06-05T04:04:26.011Z [err] git or move it out of the way first.
2019-06-05T04:04:26.147Z [err]
2019-06-05T04:04:26.147Z [err] npm ERR! A complete log of this run can be found in:
2019-06-05T04:04:26.147Z [err] npm ERR! /home/pi/.npm/_logs/2019-06-05T04_04_26_020Z-debug.log
2019-06-05T04:04:26.166Z rc=1

cd /home/pi/.node-red
npm remove node-red-contrib-widgetlords

npm ERR! path /home/pi/.node-red/node_modules/function-plot
npm ERR! code EISGIT
npm ERR! git /home/pi/.node-red/node_modules/function-plot: Appears to be a git repo or submodule.
npm ERR! git /home/pi/.node-red/node_modules/function-plot
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-06-05T04_15_38_014Z-debug.log

try

cd /home/pi/.node-red/node_modules/function-plot
ls -la

if you see .git :

rm .git

cd /home/pi/.node-red
npm remove node-red-contrib-widgetlords

pi@raspberrypi : ~ $ cd /home/pi/.node-red/node_modules/function-plot

pi@raspberrypi : ~/.node-red/node_modules/function-plot $

pi@raspberrypi : ~/.node-red/node_modules/function-plot $ ls -la

total 516

drwxr-xr-x 5 pi pi 4096 Jun 4 23:35 .

drwxr-xr-x 171 pi pi 4096 Jun 4 23:35 ..

-rw-r--r-- 1 pi pi 640 Oct 26 1985 bower.json

-rw-r--r-- 1 pi pi 13060 Oct 26 1985 CHANGELOG.md

-rw-r--r-- 1 pi pi 460 Oct 26 1985 DEVELOPMENT.md

drwxr-xr-x 2 pi pi 4096 Jun 4 23:35 dist

-rw-r--r-- 1 pi pi 261 Oct 26 1985 .editorconfig

drwxr-xr-x 7 pi pi 4096 Jun 4 23:35 .git

-rw-r--r-- 1 pi pi 35 Oct 26 1985 index.js

drwxr-xr-x 6 pi pi 4096 Jun 4 23:35 lib

-rw-r--r-- 1 pi pi 783 Oct 26 1985 .npmignore

-rw-r--r-- 1 pi pi 3388 Jun 4 23:35 package.json

-rw-r--r-- 1 pi pi 307569 Oct 26 1985 package-lock.json

-rw-r--r-- 1 pi pi 13682 Oct 26 1985 README.md

-rw-r--r-- 1 pi pi 1138 Oct 26 1985 site.js

-rw-r--r-- 1 pi pi 228 Oct 26 1985 .tmuxinator.yml

-rw-r--r-- 1 pi pi 176 Oct 26 1985 .travis.yml

-rw-r--r-- 1 pi pi 124506 Oct 26 1985 yarn.lock

pi@raspberrypi : ~/.node-red/node_modules/function-plot $ rm .git

rm: cannot remove '.git': Is a directory

pi@raspberrypi : ~/.node-red/node_modules/function-plot $

pi@raspberrypi : ~/.node-red/node_modules/function-plot $

pi@raspberrypi : ~/.node-red/node_modules/function-plot $

pi@raspberrypi : ~/.node-red/node_modules/function-plot $ cd /home/pi/.node-red

pi@raspberrypi : ~/.node-red $

pi@raspberrypi : ~/.node-red $ npm remove node-red-contrib-widgetlords

npm ERR! path /home/pi/.node-red/node_modules/function-plot

npm ERR! code EISGIT

npm ERR! git /home/pi/.node-red/node_modules/function-plot: Appears to be a git repo or submodule.

npm ERR! git /home/pi/.node-red/node_modules/function-plot

npm ERR! git Refusing to remove it. Update manually,

npm ERR! git or move it out of the way first.

npm ERR! A complete log of this run can be found in:

npm ERR! /home/pi/.npm/_logs/2019-06-05T04_48_33_536Z-debug.log

rm -r .git

pi@raspberrypi : ~/.node-red/node_modules/function-plot $ rm -r .git

pi@raspberrypi : ~/.node-red/node_modules/function-plot $ cd /home/pi/.node-red

pi@raspberrypi : ~/.node-red $ npm remove node-red-contrib-widgetlords

audited 535 packages in 6.705s

found 1 moderate severity vulnerability

run npm audit fix to fix them, or npm audit for details

pi@raspberrypi : ~/.node-red $

If you ever get stuck in npm hell. Generally the quickest and cleanest way - though it shouldn't be the first thing you do generally, better to understand what went wrong if you can - is do simply delete the node_modules folder:

cd ~/.node-red
rm package-lock.json
rm -R node_modules
npm install

That will cleanly reinstall all of the packages marked in your package.json file. So make sure that is correct first. Every time you install a package (as long as you have reasonably up-to-date versions of Node.js and npm) whether from the NR admin ui or command line, it gets added to package.json.

I now always remove the lock file as well if I'm having issues as that can be the cause of some issues. The lock file isn't generally needed in NR installations.

Note, as always, I've assumed you have a "standard" install of Node-RED which puts your userDir as ~/.node-red (and the equivalent on Windows). If you use an installation scheme like mine, it will be in a different place as noted by the command used to start NR.

Thanks, I ran with this reply:

pi@raspberrypi : ~ $ cd ~/.node-red

pi@raspberrypi : ~/.node-red $ rm package-lock.json

pi@raspberrypi : ~/.node-red $ rm -R node_modules

pi@raspberrypi : ~/.node-red $ npm install

npm WARN deprecated logspace@1.0.1: I wrote this module a very long time ago; you should use something else.

npm WARN deprecated linspace@1.0.0: I wrote this module a very long time ago; you should use something else.

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-IkDmxre5Yvb7C/PIF7Zn9LUqjTlQe2n4yNqSPo8CrLvEi59IXQJcfTCGNFK4grqLmW+3XK9nuov8cXXzh6Ge3g== integrity checksum failed when using sha512: wanted sha512-IkDmxre5Yvb7C/PIF7Zn9LUqjTlQe2n4yNqSPo8CrLvEi59IXQJcfTCGNFK4grqLmW+3XK9nuov8cXXzh6Ge3g== but got sha512-K91s0jSXJHcGp74CEJm9x+ce8vp2VzWfV/y9Hxp1EeMXnGPRxr9HCEhsoV3aarOnPMbzRnhG/iqeDZoPp9Kzug==. (2301 bytes)

npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.

npm ERR! code EINTEGRITY

npm ERR! errno EINTEGRITY

npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/buffer-alloc-unsafe: Integrity verification failed for sha512-IkDmxre5Yvb7C/PIF7Zn9LUqjTlQe2n4yNqSPo8CrLvEi59IXQJcfTCGNFK4grqLmW+3XK9nuov8cXXzh6Ge3g== (/home/pi/.npm/_cacache/content-v2/sha512/22/40/e6c6b7b962f6fb0bf3c817b667f4b52a8d39507b69f8c8da923e8f02acbbc48b9f485d025c7d30863452b882ba8b996fb75caf67ba8bfc7175f387a19ede)

npm ERR! A complete log of this run can be found in:

npm ERR! /home/pi/.npm/_logs/2019-06-05T06_03_41_848Z-debug.log

OK, something in your list of nodes is either itself way out of date or uses another package that is out of date and deprecated.

You will want to find out which. The npm debug log may give you a clue as to which node is causing the issue.

By the way, I've just posted my previous advice to my blog since this seems to be cropping up a lot at the moment.

It should appear here in a short while:

I would also note that this node only has 2 commits 1 year ago. That wouldn't seem to bode well for its maturity or stability.

I really appreciate your help. I have had this working, it was until last week when I tripped over a power cable which shorted supply to the pi and corrupted it, lost it all and building up again. But I am stuck on getting only the widgetlords node going. I have a water pressure sensor sitting on a 4-20ma current loop board attached to the pi, I believe this node is the only way to get that data value in, if there is another, then I will be okay.

Sorry for the questions or naivety, I am fairly novice and new so unsure about a fair but. Such as finding the npm log or what might be causing my issue.

Thanks

Sorry, not familiar with that and this is the first time I've noticed that node. I can't really make sense of their library but it seems to be written just for their hardware? There have only been 3 releases for their libraries which means that either the code quality is amazingly high or they really aren't investing in software development. That's just an opinion of course since I've not looked in detail nor tried their products. At a casual glance, the software would certainly put me off.

Either way, first thing now is to find out which node is causing the install issues. Then to try to get the node developers to fix things.