Hello everyone !,
I've been trying to install node-red-contrib-mcp23017 on a freshly installed instance of node red, via the suggested script for raspberry pi (3b+) running the latest raspbian.
Node.js version is v12.14.1
Npm version is Npm 6.13.4
and I keep getting build errors i can't understand, in the installation progress of it's pre-requisite node-mcp23017
this is the output i get: (I'm trimming it because of the character limit)
pi@raspberrypi:~ $ cd .node-red/
pi@raspberrypi:~/.node-red $ npm install node-mcp23017
npm WARN deprecated coffee-script@1.9.1: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
> i2c@0.2.3 install /home/pi/.node-red/node_modules/i2c
> node-gyp rebuild
...
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../node_modules/nan/nan_object_wrap.h:66:61: required from here
/home/pi/.cache/node-gyp/12.14.1/include/node/v8.h:10004:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
make: *** [i2c.target.mk:107: Release/obj.target/i2c/src/i2c.o] Error 1
make: Leaving directory '/home/pi/.node-red/node_modules/i2c/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:223:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.19.75-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-red/node_modules/i2c
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! i2c@0.2.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the i2c@0.2.3 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/2020-01-09T23_10_48_409Z-debug.log
I googled around, the "npm ERR!" lines, and here and there people had issues with either node or npm versions, so I tried installing various combination of them, with the only result of getting really frustrated and making random attempts with versions I don't even remember.
I've also been reading this post having appearently the exact same issue, but everything suggestion there, didn't help me anyway.
Before I get lost again in yet another semi-blind attempt to guess the right combination, could any of you help me make sense of these errors or better, if you had any success, pointing me to the right packages to install in order to make it work ?
Thank you all, and if you require more informations, please don't hesitate to ask.