# Node-red i2c installation error

**URL:** <https://discourse.nodered.org/t/node-red-i2c-installation-error/29005>\
**Category:** General\
**Created:** [26 June 2020 01:47 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005 "2020-06-26T01:47:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hariprabu94](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hariprabu94/32/24665_2.png) [@Hariprabu94](https://discourse.nodered.org/u/Hariprabu94)\
**Post date:** [26 June 2020 01:47 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/1 "2020-06-26T01:47:50Z")

</div>

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

Thank you.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 June 2020 06:12 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/2 "2020-06-26T06:12:46Z")

</div>

What error are you getting ?

---

<div class="post-metadata">

**Author:** ![Hariprabu94](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hariprabu94/32/24665_2.png) [@Hariprabu94](https://discourse.nodered.org/u/Hariprabu94)\
**Post date:** [26 June 2020 06:40 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/3 "2020-06-26T06:40:51Z")

</div>

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/obj.target/i2c/src/i2c.o  
2020-06-26T06:39:20.635Z [err] make: g++: Command not found  
2020-06-26T06:39:20.636Z [err] make: \*\*\* [i2c.target.mk:105: Release/obj.target/i2c/src/i2c.o] 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

---

<div class="post-metadata">

**Author:** ![Hariprabu94](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hariprabu94/32/24665_2.png) [@Hariprabu94](https://discourse.nodered.org/u/Hariprabu94)\
**Post date:** [26 June 2020 06:44 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/4 "2020-06-26T06:44:25Z")

</div>

> **[2020-06-26T06\_39\_21\_315Z-debug.log.txt](https://drive.google.com/file/d/1vTT9wUeDejWqqrzFOp17DH2Eiyba4A_7/view?usp=sharing)**
>
> Google Drive file.

am attached link of error log file

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 June 2020 07:51 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/5 "2020-06-26T07:51:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 June 2020 09:38 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/6 "2020-06-26T09:38:42Z")

</div>

> [@Hariprabu94](#):
>
> i2c-bus@5.2.0 install /root/.node-red/node\_modules/i2c-bus

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

---

<div class="post-metadata">

**Author:** ![Hariprabu94](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hariprabu94/32/24665_2.png) [@Hariprabu94](https://discourse.nodered.org/u/Hariprabu94)\
**Post date:** [26 June 2020 12:29 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/7 "2020-06-26T12:29:57Z")

</div>

i will try.. and let you know

---

<div class="post-metadata">

**Author:** ![Hariprabu94](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hariprabu94/32/24665_2.png) [@Hariprabu94](https://discourse.nodered.org/u/Hariprabu94)\
**Post date:** [26 June 2020 12:33 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/8 "2020-06-26T12:33:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hariprabu94](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hariprabu94/32/24665_2.png) [@Hariprabu94](https://discourse.nodered.org/u/Hariprabu94)\
**Post date:** [27 June 2020 12:16 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/9 "2020-06-27T12:16:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 August 2020 12:16 UTC](https://discourse.nodered.org/t/node-red-i2c-installation-error/29005/10 "2020-08-26T12:16:24Z")

</div>

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