Node-red i2c installation error

Hi, i tried to install i2c bus through node-red dashboard and npm command. But am getting error with installation. Kindly assist

Thank you.

What error are you getting ?

Thanks for your reply,

2020-06-26T06:39:00.953Z Install : node-red-contrib-i2c 0.7.0

2020-06-26T06:39:01.050Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-i2c@0.7.0
2020-06-26T06:39:15.893Z [out]
2020-06-26T06:39:15.893Z [out] > i2c-bus@5.2.0 install /root/.node-red/node_modules/i2c-bus
2020-06-26T06:39:15.893Z [out] > node-gyp rebuild
2020-06-26T06:39:15.893Z [out]
2020-06-26T06:39:20.610Z [out] make: Entering directory '/root/.node-red/node_modules/i2c-bus/build'
2020-06-26T06:39:20.614Z [out] CXX(target) Release/
2020-06-26T06:39:20.635Z [err] make: g++: Command not found
2020-06-26T06:39:20.636Z [err] make: *** [ Release/] Error 127
2020-06-26T06:39:20.637Z [out] make: Leaving directory '/root/.node-red/node_modules/i2c-bus/build'
2020-06-26T06:39:20.644Z [err] gyp
2020-06-26T06:39:20.646Z [err]
2020-06-26T06:39:20.646Z [err] ERR! build error
2020-06-26T06:39:20.647Z [err]
2020-06-26T06:39:20.649Z [err] gyp
2020-06-26T06:39:20.650Z [err] ERR! stack
2020-06-26T06:39:20.650Z [err] Error: make failed with exit code: 2
2020-06-26T06:39:20.650Z [err] gyp
2020-06-26T06:39:20.650Z [err] ERR!
2020-06-26T06:39:20.651Z [err] stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
2020-06-26T06:39:20.651Z [err] gyp
2020-06-26T06:39:20.651Z [err] ERR! stack
2020-06-26T06:39:20.651Z [err] at ChildProcess.emit (events.js:198:13)
2020-06-26T06:39:20.651Z [err] gyp
2020-06-26T06:39:20.652Z [err] ERR!
2020-06-26T06:39:20.652Z [err] stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
2020-06-26T06:39:20.653Z [err] gyp
2020-06-26T06:39:20.654Z [err] ERR!
2020-06-26T06:39:20.654Z [err] System Linux 4.19.97-v7
2020-06-26T06:39:20.655Z [err] gyp
2020-06-26T06:39:20.655Z [err] ERR!
2020-06-26T06:39:20.655Z [err] command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-06-26T06:39:20.656Z [err] gyp
2020-06-26T06:39:20.656Z [err] ERR!
2020-06-26T06:39:20.656Z [err] cwd /root/.node-red/node_modules/i2c-bus
2020-06-26T06:39:20.657Z [err] gyp ERR!
2020-06-26T06:39:20.657Z [err] node -v
2020-06-26T06:39:20.657Z [err] v10.20.1
2020-06-26T06:39:20.657Z [err] gyp
2020-06-26T06:39:20.658Z [err] ERR!
2020-06-26T06:39:20.658Z [err] node-gyp -v v5.1.0
2020-06-26T06:39:20.658Z [err] gyp ERR!
2020-06-26T06:39:20.659Z [err] not ok
2020-06-26T06:39:20.659Z [err]
2020-06-26T06:39:21.264Z [err] npm
2020-06-26T06:39:21.265Z [err] WARN bootstrap@4.5.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
2020-06-26T06:39:21.266Z [err]
2020-06-26T06:39:21.295Z [err] npm
2020-06-26T06:39:21.296Z [err] ERR! code
2020-06-26T06:39:21.296Z [err] ELIFECYCLE
2020-06-26T06:39:21.297Z [err] npm
2020-06-26T06:39:21.297Z [err] ERR!
2020-06-26T06:39:21.298Z [err] errno 1
2020-06-26T06:39:21.299Z [err] npm
2020-06-26T06:39:21.299Z [err] ERR!
2020-06-26T06:39:21.299Z [err] i2c-bus@5.2.0 install: node-gyp rebuild
2020-06-26T06:39:21.299Z [err] npm
2020-06-26T06:39:21.300Z [err] ERR! Exit status 1
2020-06-26T06:39:21.300Z [err] npm
2020-06-26T06:39:21.301Z [err] ERR!
2020-06-26T06:39:21.301Z [err]
2020-06-26T06:39:21.301Z [err] npm
2020-06-26T06:39:21.302Z [err] ERR! Failed at the i2c-bus@5.2.0 install script.
2020-06-26T06:39:21.302Z [err] npm ERR!
2020-06-26T06:39:21.302Z [err] This is probably not a problem with npm. There is likely additional logging output above.
2020-06-26T06:39:21.334Z [err]
2020-06-26T06:39:21.335Z [err] npm ERR! A complete log of this run can be found in:
2020-06-26T06:39:21.335Z [err] npm ERR! /root/.npm/_logs/2020-06-26T06_39_21_315Z-debug.log
2020-06-26T06:39:21.369Z rc=1
am getting this error while installing

am attached link of error log file

The line 2020-06-26T06:39:20.635Z [err] make: g++: Command not found
shows that you don't (yet) have the necessary tools installed - as the i2c node requires a compiler to build the necessary binary bindings.

Usually something like sudo apt install build-essential python-dev should be enough to get the pieces required - then retry the install.

Can I ask why you have NR installed under root?
What platform/os are you using?

i will try.. and let you know

when am installed node-red, automatically its created under root folder. Installation problems only with i2c and gpio nodes. Other nodes are working fine. My i2c device is working fine from i2cdetect -y 1. Am using raspberrypi 3. I built OS through buildroot.

Thank you

Good Evening. I tried with python script in node-red. Am getting output.....

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