# Node-red-contrib-i2c is unsupported

**URL:** <https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753>\
**Category:** General\
**Created:** [4 April 2022 06:36 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753 "2022-04-04T06:36:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![elektronik-freak](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@elektronik-freak](https://discourse.nodered.org/u/elektronik-freak)\
**Post date:** [4 April 2022 06:36 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/1 "2022-04-04T06:36:52Z")

</div>

The `node-red-contrib-i2c` is saying unsupported in NodRed version 2.2.2

npm -v 8.5.0

The I2C is working on the console, so looks like somthenthing with nodred.  
With NodRed 2.2.0 it works great.

Is there somthing I can do to fix ?

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [4 April 2022 07:16 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/2 "2022-04-04T07:16:16Z")

</div>

Show us the exact error message and explain how/where it was shown.

---

<div class="post-metadata">

**Author:** ![elektronik-freak](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@elektronik-freak](https://discourse.nodered.org/u/elektronik-freak)\
**Post date:** [4 April 2022 08:04 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/3 "2022-04-04T08:04:40Z")

</div>

Hi hardillb, please see screenshot attached.  
I added the other nodes from this library to see what they say. But it's the same.

hanks

 ![ic2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/9946d68b76feaf019c9a3f0bbd9ed487e6ced0e1.jpeg)

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [4 April 2022 08:09 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/4 "2022-04-04T08:09:59Z")

</div>

Look in the Node-RED logs (the system console not the browser) it should have printed an error message.

---

<div class="post-metadata">

**Author:** ![elektronik-freak](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@elektronik-freak](https://discourse.nodered.org/u/elektronik-freak)\
**Post date:** [4 April 2022 08:16 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/5 "2022-04-04T08:16:16Z")

</div>

Hi,  
4 Apr 10:14:28 - [info] Starting flows  
4 Apr 10:14:28 - [info] [i2c in:I2C IO IN] Couldn't load i2c-bus, is your platform supported ?  
Error: The module '/home/pi/.node-red/node\_modules/i2c-bus/build/Release/i2c.node'  
was compiled against a different Node.js version using  
NODE\_MODULE\_VERSION 83. This version of Node.js requires  
NODE\_MODULE\_VERSION 93. Please try re-compiling or re-installing  
the module (for instance, using `npm rebuild` or `npm install`).  
at Object.Module.\_extensions..node (node:internal/modules/cjs/loader:1187:18)  
at Module.load (node:internal/modules/cjs/loader:981:32)  
at Function.Module.\_load (node:internal/modules/cjs/loader:822:12)  
at Module.require (node:internal/modules/cjs/loader:1005:19)  
at require (node:internal/modules/cjs/helpers:102:18)  
at bindings (/home/pi/.node-red/node\_modules/bindings/bindings.js:112:48)  
at Object. (/home/pi/.node-red/node\_modules/i2c-bus/i2c-bus.js:4:32)  
at Module.\_compile (node:internal/modules/cjs/loader:1103:14)  
at Object.Module.\_extensions..js (node:internal/modules/cjs/loader:1157:10)  
at Module.load (node:internal/modules/cjs/loader:981:32)  
at Function.Module.\_load (node:internal/modules/cjs/loader:822:12)  
at Module.require (node:internal/modules/cjs/loader:1005:19)  
at require (node:internal/modules/cjs/helpers:102:18)  
at module.exports (/home/pi/.node-red/node\_modules/node-red-contrib-i2c/i2c/26-i2c.js:4:19)  
at loadNodeSet (/usr/local/lib/node\_modules/node-red/node\_modules/@node-red/registry/lib/loader.js:365:27)  
at /usr/local/lib/node\_modules/node-red/node\_modules/@node-red/registry/lib/loader.js:459:31 {  
code: 'ERR\_DLOPEN\_FAILED'  
}  
4 Apr 10:14:28 - [info] [i2c in:I2C IO IN] Couldn't load i2c-bus, is your platform supported ?  
Error: The module '/home/pi/.node-red/node\_modules/i2c-bus/build/Release/i2c.node'  
was compiled against a different Node.js version using  
NODE\_MODULE\_VERSION 83. This version of Node.js requires  
NODE\_MODULE\_VERSION 93. Please try re-compiling or re-installing

---

<div class="post-metadata">

**Author:** ![elektronik-freak](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@elektronik-freak](https://discourse.nodered.org/u/elektronik-freak)\
**Post date:** [4 April 2022 08:21 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/6 "2022-04-04T08:21:46Z")

</div>

I already did:

pi@nodered:~ $ npm install node-red-contrib-i2c

up to date, audited 6 packages in 3s

found 0 vulnerabilities

and

npm rebuild

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [4 April 2022 08:59 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/7 "2022-04-04T08:59:14Z")

</div>

I don't know how npm works but maybe its needs fully removing and then re-installing?

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [4 April 2022 09:15 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/8 "2022-04-04T09:15:51Z")

</div>

You need to run `npm rebuild` from in the userDir not your home directory (which is what your last post shows).

The default useDir is `/home/pi/.node-red`

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 April 2022 09:16 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/9 "2022-04-04T09:16:15Z")

</div>

Have you installed `n` or `nvm`?

What does running the 2 below commands show you? ...

```auto
node --version
sudo node --version

```

Lastly, have you recently updated node-js?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 April 2022 09:17 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/10 "2022-04-04T09:17:57Z")

</div>

> [@elektronik-freak](#):
>
> pi@nodered:~ $ npm install node-red-contrib-i2c

`pi@nodered:~ $` 👈 this is the wrong directory.  
You should be in `/home/pi/.node-red` before running `npm`

[edit]  
What @hardillb says

---

<div class="post-metadata">

**Author:** ![elektronik-freak](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@elektronik-freak](https://discourse.nodered.org/u/elektronik-freak)\
**Post date:** [4 April 2022 12:09 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/11 "2022-04-04T12:09:59Z")

</div>

Hi hardillb and all,

thanks a lot, the dir was the issue.

---

<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:** [18 April 2022 12:10 UTC](https://discourse.nodered.org/t/node-red-contrib-i2c-is-unsupported/60753/12 "2022-04-18T12:10:21Z")

</div>

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