Node-red-contrib-i2c fails to install

I can't install the following

npm install node-red-contrib-i2c

npm install node-red-contrib-i2c

npm ERR! code EISDIR
npm ERR! syscall read
npm ERR! errno -21
npm ERR! EISDIR: illegal operation on a directory, read

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-12-04T05_05_30_126Z-debug.log

npm -v

6.13.1

node -v

v13.2.0

18 verbose stack Error: EISDIR: illegal operation on a directory, read
19 verbose cwd /home/pi
20 verbose Linux 4.19.75-v7l+
21 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "node-red-contrib-i2c"
22 verbose node v13.2.0
23 verbose npm v6.13.1
24 error code EISDIR
25 error syscall read
26 error errno -21
27 error EISDIR: illegal operation on a directory, read
28 verbose exit [ -21, true ]

Did you try to install it via the node-red editor ?
hamburger menu > manage palette

What hardware and OS are you running on?
I note that you are using an unsupported version of nodejs (13.2.0) which may be a factor.
https://nodered.org/docs/faq/node-versions

As Colin says, this is not a sensible choice of node.js version for developing solutions. It is a development version of node.js and so is unstable and unsupported by most packages.

On the Raspberry Pi it trys to use the Pi account info instead of root. Ypi have to do a 'sudo su' to get roots shell and be in the /root directory. Then run the npm init to set it up before you are in the right place and permissions to install. Most of the contribs need to be under roots account to have access to the OS hardware it seems.

Old timer here playing with new toys. Takes me a little time to read the op codes to debug my mistakes.

I need to look into dtrace for RPI. Remember on your Apple HDWR the Apple morons hide OS fucnctionality from DTRACE to not show their poor coding issues.

OK i'm on the rode-red GUI trying to load node-red-contrib-i2c. It is failing from the log as follows. I am trying to keep it short. Any ideas?

2019-12-05T03:34:47.944Z [out] make: Leaving directory '/root/.node-red/node_modules/i2c-bus/build' 2019-12-05T03:34:47.947Z [err] gyp 2019-12-05T03:34:47.947Z [err] 2019-12-05T03:34:47.947Z [err] ERR! build error 2019-12-05T03:34:47.947Z [err] 2019-12-05T03:34:47.949Z [err] gyp 2019-12-05T03:34:47.949Z [err] ERR! 2019-12-05T03:34:47.949Z [err] stack 2019-12-05T03:34:47.949Z [err] Error: makefailed with exit code: 2 2019-12-05T03:34:47.949Z [err] gyp 2019-12-05T03:34:47.949Z [err] ERR! 2019-12-05T03:34:47.949Z [err] stack 2019-12-05T03:34:47.949Z [err] at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) 2019-12-05T03:34:47.949Z [err] gyp 2019-12-05T03:34:47.949Z [err] ERR! 2019-12-05T03:34:47.949Z [err] stack 2019-12-05T03:34:47.950Z [err] at ChildProcess.emit (events.js:210:5) 2019-12-05T03:34:47.950Z [err] gyp 2019-12-05T03:34:47.950Z [err] ERR! 2019-12-05T03:34:47.950Z [err] stack at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12) 2019-12-05T03:34:47.950Z [err] gyp 2019-12-05T03:34:47.950Z [err] ERR! 2019-12-05T03:34:47.951Z [err] System Linux 4.19.75-v7l+ 2019-12-05T03:34:47.951Z [err] gyp 2019-12-05T03:34:47.951Z [err] ERR! 2019-12-05T03:34:47.951Z [err] command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 2019-12-05T03:34:47.951Z [err] gyp ERR! cwd 2019-12-05T03:34:47.951Z [err] /root/.node-red/node_modules/i2c-bus 2019-12-05T03:34:47.951Z [err] gyp 2019-12-05T03:34:47.951Z [err] ERR! node -v 2019-12-05T03:34:47.951Z [err] v13.2.0 2019-12-05T03:34:47.951Z [err] gyp 2019-12-05T03:34:47.952Z [err] ERR! 2019-12-05T03:34:47.952Z [err] node-gyp -v v5.0.5 2019-12-05T03:34:47.952Z [err] gyp ERR! 2019-12-05T03:34:47.952Z [err] not ok 2019-12-05T03:34:48.187Z [err] npm ERR! code ELIFECYCLE 2019-12-05T03:34:48.187Z [err] npm ERR! errno 1 2019-12-05T03:34:48.187Z [err] npm ERR! i2c-bus@1.2.5 install:node-gyp rebuild 2019-12-05T03:34:48.187Z [err] npm ERR! Exit status 1 2019-12-05T03:34:48.187Z [err] npm ERR! 2019-12-05T03:34:48.187Z [err] npm ERR! 2019-12-05T03:34:48.187Z [err] Failed at the i2c-bus@1.2.5 install script. 2019-12-05T03:34:48.187Z [err] npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2019-12-05T03:34:48.204Z [err] 2019-12-05T03:34:48.204Z [err] npm ERR! A complete log of this run can be found in: 2019-12-05T03:34:48.205Z [err] npm ERR! /root/.npm/_logs/2019-12-05T03_34_48_190Z-debug.log 2019-12-05T03:34:48.215Z rc=1

Also I am running on a Raspberry Pi 4 4GB. With 512GB card running latest code.

I can drop node.js back a release, any suggestion?

I've droped back to the 12 version of nodejs

root@proelian:~# node -v
v12.13.1

Has that fixed the problem?
Note that you really should not be installing as root unless you have a very good reason. There are alternative ways of getting round permissions issues, if you can't work it out then ask here.

Sorry, but this is incorrect and dangerous. Especially if you ever want to share that Pi with the outside world.

Node-RED does not need to nor should it ever run as root and doing so will simply create other issues.

If you need to give Node-RED direct access to hardware on the Pi, you simply need to know what permissions that hardware has and then make sure that the "user" running Node-RED (normally pi) is in the correct security group.

In the above example from my own Pi, you can see that, to access the ttyAMA0 device, the user needs to be in the dialout group.

In some extreme cases, you might need to adjust the group permissions on a device so that its owning group is dialout or something similar rather than root. You should never need to change the user ownership.

I think that the Node-RED installation documentation makes this clear. Dave also publishes and maintains a script that will do everything for you on a Pi, that is also in the documentation.

1 Like

I am doing the install inside the node-red web page console now. It is still failing.

I am running as Pi now.

It just fails to install. I can install other node packages, but just not this one.

2019-12-08T17:00:40.184Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.184Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.184Z [err] In file included from ../src/i2c.cc:101:
2019-12-08T17:00:40.184Z [err] ../src/./sendbyte.cc:48:35: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.184Z [err]    __u8 byte = info[1]->Int32Value();
2019-12-08T17:00:40.184Z [err]                                    ^
2019-12-08T17:00:40.184Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.184Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.184Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.184Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.184Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.184Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.185Z [err] In file included from ../src/i2c.cc:101:
2019-12-08T17:00:40.185Z [err] ../src/./sendbyte.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE SendByteSync(Nan::NAN_METHOD_ARGS_TYPE)’:
2019-12-08T17:00:40.185Z [err] ../src/./sendbyte.cc:60:32: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.185Z [err]    int fd = info[0]->Int32Value();
2019-12-08T17:00:40.185Z [err]                                 ^
2019-12-08T17:00:40.185Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.185Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.185Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.185Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.185Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.185Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.185Z [err] In file included from ../src/i2c.cc:101:
2019-12-08T17:00:40.185Z [err] ../src/./sendbyte.cc:61:35: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.185Z [err]    __u8 byte = info[1]->Int32Value();
2019-12-08T17:00:40.185Z [err]                                    ^
2019-12-08T17:00:40.185Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.185Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.185Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.185Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.185Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.185Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.188Z [err] In file included from ../src/i2c.cc:102:
2019-12-08T17:00:40.188Z [err] ../src/./setaddr.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE SetAddrAsync(Nan::NAN_METHOD_ARGS_TYPE)’:
2019-12-08T17:00:40.188Z [err] ../src/./setaddr.cc:47:32: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.188Z [err]    int fd = info[0]->Int32Value();
2019-12-08T17:00:40.188Z [err]                                 ^
2019-12-08T17:00:40.188Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.188Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.188Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.188Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.188Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.188Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.188Z [err] In file included from ../src/i2c.cc:102:
2019-12-08T17:00:40.188Z [err] ../src/./setaddr.cc:48:34: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.188Z [err]    int addr = info[1]->Int32Value();
2019-12-08T17:00:40.188Z [err]                                   ^
2019-12-08T17:00:40.188Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.188Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.188Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.188Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.188Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.188Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.188Z [err] In file included from ../src/i2c.cc:102:
2019-12-08T17:00:40.188Z [err] ../src/./setaddr.cc:49:44: error: no matching function for call to ‘v8::Value::BooleanValue()’
2019-12-08T17:00:40.188Z [err]    bool forceAccess = info[2]->BooleanValue();
2019-12-08T17:00:40.188Z [err]                                             ^
2019-12-08T17:00:40.188Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.188Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.188Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2603:8: note: candidate: ‘bool v8::Value::BooleanValue(v8::Isolate*) const’
2019-12-08T17:00:40.188Z [err]    bool BooleanValue(Isolate* isolate) const;
2019-12-08T17:00:40.188Z [err]         ^~~~~~~~~~~~
2019-12-08T17:00:40.188Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2603:8: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.189Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/v8-internal.h:14,
2019-12-08T17:00:40.189Z [err]                  from /root/.cache/node-gyp/12.13.1/include/node/v8.h:25,
2019-12-08T17:00:40.189Z [err]                  from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.189Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.189Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2606:51: note: candidate: ‘v8::Maybe<bool> v8::Value::BooleanValue(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.189Z [err]                  V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
2019-12-08T17:00:40.189Z [err]                                                    ^~~~~~~~~~~~
2019-12-08T17:00:40.189Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
2019-12-08T17:00:40.189Z [err]    declarator __attribute__((deprecated(message)))
2019-12-08T17:00:40.189Z [err]    ^~~~~~~~~~
2019-12-08T17:00:40.189Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2606:51: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.189Z [err]                  V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
2019-12-08T17:00:40.189Z [err]                                                    ^~~~~~~~~~~~
2019-12-08T17:00:40.189Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
2019-12-08T17:00:40.189Z [err]    declarator __attribute__((deprecated(message)))
2019-12-08T17:00:40.189Z [err]    ^~~~~~~~~~
2019-12-08T17:00:40.193Z [err] In file included from ../src/i2c.cc:102:
2019-12-08T17:00:40.193Z [err] ../src/./setaddr.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE SetAddrSync(Nan::NAN_METHOD_ARGS_TYPE)’:
2019-12-08T17:00:40.193Z [err] ../src/./setaddr.cc:61:32: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.193Z [err]    int fd = info[0]->Int32Value();
2019-12-08T17:00:40.193Z [err]                                 ^
2019-12-08T17:00:40.193Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.193Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.193Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.193Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.193Z [err] In file included from ../src/i2c.cc:102:
2019-12-08T17:00:40.193Z [err] ../src/./setaddr.cc:62:34: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.193Z [err]    int addr = info[1]->Int32Value();
2019-12-08T17:00:40.193Z [err]                                   ^
2019-12-08T17:00:40.193Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.193Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.193Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.193Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.193Z [err] In file included from ../src/i2c.cc:102:
2019-12-08T17:00:40.193Z [err] ../src/./setaddr.cc:63:44: error: no matching function for call to ‘v8::Value::BooleanValue()’
2019-12-08T17:00:40.193Z [err]    bool forceAccess = info[2]->BooleanValue();
2019-12-08T17:00:40.193Z [err]                                             ^
2019-12-08T17:00:40.193Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.193Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2603:8: note: candidate: ‘bool v8::Value::BooleanValue(v8::Isolate*) const’
2019-12-08T17:00:40.193Z [err]    bool BooleanValue(Isolate* isolate) const;
2019-12-08T17:00:40.193Z [err]         ^~~~~~~~~~~~
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2603:8: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.193Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/v8-internal.h:14,
2019-12-08T17:00:40.193Z [err]                  from /root/.cache/node-gyp/12.13.1/include/node/v8.h:25,
2019-12-08T17:00:40.193Z [err]                  from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.193Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2606:51: note: candidate: ‘v8::Maybe<bool> v8::Value::BooleanValue(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.193Z [err]                  V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
2019-12-08T17:00:40.193Z [err]                                                    ^~~~~~~~~~~~
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
2019-12-08T17:00:40.193Z [err]    declarator __attribute__((deprecated(message)))
2019-12-08T17:00:40.193Z [err]    ^~~~~~~~~~
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2606:51: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.193Z [err]                  V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
2019-12-08T17:00:40.193Z [err]                                                    ^~~~~~~~~~~~
2019-12-08T17:00:40.193Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
2019-12-08T17:00:40.193Z [err]    declarator __attribute__((deprecated(message)))
2019-12-08T17:00:40.193Z [err]    ^~~~~~~~~~
2019-12-08T17:00:40.194Z [err] In file included from ../src/i2c.cc:103:
2019-12-08T17:00:40.194Z [err] ../src/./writebyte.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE WriteByteAsync(Nan::NAN_METHOD_ARGS_TYPE)’:
2019-12-08T17:00:40.194Z [err] ../src/./writebyte.cc:49:32: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.194Z [err]    int fd = info[0]->Int32Value();
2019-12-08T17:00:40.194Z [err]                                 ^
2019-12-08T17:00:40.195Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.195Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.195Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.195Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.195Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.195Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.195Z [err] In file included from ../src/i2c.cc:103:
2019-12-08T17:00:40.195Z [err] ../src/./writebyte.cc:50:34: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.195Z [err]    __u8 cmd = info[1]->Int32Value();
2019-12-08T17:00:40.195Z [err]                                   ^
2019-12-08T17:00:40.195Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.195Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.195Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.195Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.195Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.195Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.195Z [err] In file included from ../src/i2c.cc:103:
2019-12-08T17:00:40.195Z [err] ../src/./writebyte.cc:51:35: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.195Z [err]    __u8 byte = info[2]->Int32Value();
2019-12-08T17:00:40.195Z [err]                                    ^
2019-12-08T17:00:40.195Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.195Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.195Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.195Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.195Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.195Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.196Z [err] In file included from ../src/i2c.cc:103:
2019-12-08T17:00:40.196Z [err] ../src/./writebyte.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE WriteByteSync(Nan::NAN_METHOD_ARGS_TYPE)’:
2019-12-08T17:00:40.196Z [err] ../src/./writebyte.cc:63:32: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.196Z [err]    int fd = info[0]->Int32Value();
2019-12-08T17:00:40.196Z [err]                                 ^
2019-12-08T17:00:40.196Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.196Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.196Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.196Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.196Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.196Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.196Z [err] In file included from ../src/i2c.cc:103:
2019-12-08T17:00:40.196Z [err] ../src/./writebyte.cc:64:34: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.196Z [err]    __u8 cmd = info[1]->Int32Value();
2019-12-08T17:00:40.196Z [err]                                   ^
2019-12-08T17:00:40.196Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.196Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.196Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.196Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.196Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.196Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.196Z [err] In file included from ../src/i2c.cc:103:
2019-12-08T17:00:40.196Z [err] ../src/./writebyte.cc:65:35: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.196Z [err]    __u8 byte = info[2]->Int32Value();
2019-12-08T17:00:40.196Z [err]                                    ^
2019-12-08T17:00:40.196Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.196Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.196Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.196Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.196Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.196Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.199Z [err] In file included from ../src/i2c.cc:104:
2019-12-08T17:00:40.199Z [err] ../src/./writeword.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE WriteWordAsync(Nan::NAN_METHOD_ARGS_TYPE)’:
2019-12-08T17:00:40.199Z [err] ../src/./writeword.cc:49:32: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.199Z [err]    int fd = info[0]->Int32Value();
2019-12-08T17:00:40.199Z [err]                                 ^
2019-12-08T17:00:40.199Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.199Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.199Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.199Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.199Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.199Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.199Z [err] In file included from ../src/i2c.cc:104:
2019-12-08T17:00:40.199Z [err] ../src/./writeword.cc:50:34: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.199Z [err]    __u8 cmd = info[1]->Int32Value();
2019-12-08T17:00:40.199Z [err]                                   ^
2019-12-08T17:00:40.200Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.200Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.200Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.200Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.200Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.200Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.200Z [err] In file included from ../src/i2c.cc:104:
2019-12-08T17:00:40.200Z [err] ../src/./writeword.cc:51:36: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.200Z [err]    __u16 word = info[2]->Int32Value();
2019-12-08T17:00:40.200Z [err]                                     ^
2019-12-08T17:00:40.200Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.200Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.200Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.200Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.200Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.200Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.201Z [err] In file included from ../src/i2c.cc:104:
2019-12-08T17:00:40.201Z [err] ../src/./writeword.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE WriteWordSync(Nan::NAN_METHOD_ARGS_TYPE)’:
2019-12-08T17:00:40.201Z [err] ../src/./writeword.cc:64:32: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.201Z [err]    int fd = info[0]->Int32Value();
2019-12-08T17:00:40.201Z [err]                                 ^
2019-12-08T17:00:40.201Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.201Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.201Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.201Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.201Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.201Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.201Z [err] In file included from ../src/i2c.cc:104:
2019-12-08T17:00:40.201Z [err] ../src/./writeword.cc:65:34: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.201Z [err]    __u8 cmd = info[1]->Int32Value();
2019-12-08T17:00:40.201Z [err]                                   ^
2019-12-08T17:00:40.201Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.201Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.201Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.201Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.201Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.201Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.201Z [err] In file included from ../src/i2c.cc:104:
2019-12-08T17:00:40.201Z [err] ../src/./writeword.cc:66:36: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.201Z [err]    __u16 word = info[2]->Int32Value();
2019-12-08T17:00:40.201Z [err]                                     ^
2019-12-08T17:00:40.201Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.201Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.201Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.201Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.201Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.201Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.205Z [err] In file included from ../src/i2c.cc:105:
2019-12-08T17:00:40.205Z [err] ../src/./writeblock.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE WriteBlockAsync(Nan::NAN_METHOD_ARGS_TYPE)’:
2019-12-08T17:00:40.205Z [err] ../src/./writeblock.cc:70:32: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.205Z [err]    int fd = info[0]->Int32Value();
2019-12-08T17:00:40.205Z [err]                                 ^
2019-12-08T17:00:40.205Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.205Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.205Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.205Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.205Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.205Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.205Z [err] In file included from ../src/i2c.cc:105:
2019-12-08T17:00:40.205Z [err] ../src/./writeblock.cc:71:34: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.205Z [err]    __u8 cmd = info[1]->Int32Value();
2019-12-08T17:00:40.205Z [err]                                   ^
2019-12-08T17:00:40.206Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.206Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.206Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.206Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.206Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.206Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.206Z [err] In file included from ../src/i2c.cc:105:
2019-12-08T17:00:40.206Z [err] ../src/./writeblock.cc:72:39: error: no matching function for call to ‘v8::Value::Uint32Value()’
2019-12-08T17:00:40.206Z [err]    __u32 length = info[2]->Uint32Value();
2019-12-08T17:00:40.206Z [err]                                        ^
2019-12-08T17:00:40.206Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.206Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.206Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2611:41: note: candidate: ‘v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.206Z [err]    V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
2019-12-08T17:00:40.206Z [err]                                          ^~~~~~~~~~~
2019-12-08T17:00:40.206Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2611:41: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.208Z [err] In file included from ../src/i2c.cc:105:
2019-12-08T17:00:40.208Z [err] ../src/./writeblock.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE WriteBlockSync(Nan::NAN_METHOD_ARGS_TYPE)’:
2019-12-08T17:00:40.208Z [err] ../src/./writeblock.cc:110:32: error: no matching function for call to ‘v8::Value::Int32Value()’
2019-12-08T17:00:40.208Z [err]    int fd = info[0]->Int32Value();
2019-12-08T17:00:40.208Z [err]                                 ^
2019-12-08T17:00:40.209Z [err] In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
2019-12-08T17:00:40.209Z [err]                  from ../src/i2c.cc:1:
2019-12-08T17:00:40.209Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
2019-12-08T17:00:40.209Z [err]    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
2019-12-08T17:00:40.209Z [err]                                         ^~~~~~~~~~
2019-12-08T17:00:40.209Z [err] /root/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
2019-12-08T17:00:40.209Z [err] In file included from ../src/i2c.cc:105:
2019-12-08T17:00:40.209Z [err] ../src/./writeblock.cc:111:34: error: no matching function for call to ‘v8::Value::Int32Value()```

I think we are making progress, it just doesn't seem like it :grinning:

You will note that this is still accessing a cache in root which I'm not certain about. The .cache folder should be in your local home folder not under root.

Did you run the install using Dave's official Pi install script as per the documentation?

I think that you need to clear out that /root/.cache, make sure you have nothing Node-RED related installed globally npm -g ls --depth=0. You might also need to do npm cache clear --force (ignore the dire warnings).

Next, make sure that the ~/.node-red/package.json file has the nodes that you want in the dependencies section. Then delete the ~/.node-red/node_modules folder and finally, from within ~/.node-red/, do npm install.

Everything should now be rebuilt cleanly.

If you didn't rebuild node-red when you changed Node.js versions, I'd suggest removing node-red completely then using Dave's script to get everything correct.

Followed all your suggestions. Same Error. Somehow this code needs some root functionality not well documented.

Followed all your suggestions

Did you? It is still running under root.

root functionality not well documented.

There is your hint: you should not need root to install anything, which is why it is not documented.

Suggestion: reinstall node-red using the official script, under a “normal” user account (ie. pi)

This will not solve your problem with this i2c node, but prevents other (security) issues.

The problem is with the node itself, your logs show node v8, the node was created with this version, when running this under v13, certain functions may be incompatible causing the install to fail. I remember seeing more topics about the i2c node. If those don’t help; open an issue on github page of the node (if it is still maintained).

Can you point to proper instructions you would follow to remove and reinstall?

Nodejs
NPM
NODE-RED

Would all need to be removed and reloaded

removed and reinstalled completely. I received a new NCD i2c Thermometer device today and tried to install the ncd-red-comm node. It falis too. It seems that both packages depend on i2c-bus node, and that under the latest Pi 4 and buster release its broken. Anyone hear anything about this?

How did you install node red?

I just installed node-red-contrib-i2c on a pi4 running Buster and plugged in an i2c device and it seems to work

2 Likes

Using Dave's script?

I just got this from the maintainer nielsnl68

"Sorry to say, i have stopped using this node for some time now.
When someone can create a Pull request with the above fix then I'm willing to commit it direct away.
And let me know of all works better then before."

I removed everything and used daves script too.

I also have been in contact with Brian Cooke the maintainer of i2c-bus and he sent me this.

You'll need to look at package.json for node-red-contrib-i2c v0.5.2 to see that it depends on an old version of :

This needs to be changed to the current codebase

{
  "name": "node-red-contrib-i2c",
  "version": "0.5.1",
  "description": "A Node-RED node to talk to the Raspiberry PI's I2C port",
  "dependencies": {
    "i2c-bus": "^1.2.2"
  },