Hi there
I have RPi B rev 2 and it was running old Raspbian. I decided to upgrade the whole stack and put the latest RPi OS to fresh SD card. I was trying to get IOTstack docker to handle it all but there was so many errors that after few days I gave up. The reason is probably that my RPi is ARMv6 and most of modern docker containers target is ARMv7.
Anyway, I went the traditional way of installing everything directly on OS. After installing Node-RED I copied the whole folder ~/.node-red from previous instance but it failed to load mentioned MCP23017 node and serial-port. So I got rid of node_modules and do npm install from scratch. While serial-port is fine now, MCP node is not and it's crucial to my flows as it handles all windows/doors switches.
Palette manager in NR shows such error:
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 64. This version of Node.js requires NODE_MODULE_VERSION 72. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`). (line:3)
npm rebuild did not fix the issue
npm install shows dozens of screens of errors, the final excerpt looks like this:
/home/pi/.cache/node-gyp/12.19.0/include/node/v8.h:2709:40: note: candidate expects 1 argument, 0 provided
In file included from ../src/i2c.cc:107:
../src/./writequick.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE WriteQuickSync(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/./writequick.cc:60:32: error: no matching function for call to ‘v8::Value::Int32Value()’
int fd = info[0]->Int32Value();
^
In file included from /home/pi/.cache/node-gyp/12.19.0/include/node/node.h:67,
from ../src/i2c.cc:1:
/home/pi/.cache/node-gyp/12.19.0/include/node/v8.h:2709:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
^~~~~~~~~~
/home/pi/.cache/node-gyp/12.19.0/include/node/v8.h:2709:40: note: candidate expects 1 argument, 0 provided
In file included from ../src/i2c.cc:107:
../src/./writequick.cc:61:34: error: no matching function for call to ‘v8::Value::Int32Value()’
__u8 bit = info[1]->Int32Value();
^
In file included from /home/pi/.cache/node-gyp/12.19.0/include/node/node.h:67,
from ../src/i2c.cc:1:
/home/pi/.cache/node-gyp/12.19.0/include/node/v8.h:2709:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
^~~~~~~~~~
/home/pi/.cache/node-gyp/12.19.0/include/node/v8.h:2709:40: note: candidate expects 1 argument, 0 provided
make: *** [i2c.target.mk:111: Release/obj.target/i2c/src/i2c.o] Error 1
make: Leaving directory '/home/pi/.node-red/node_modules/i2c-bus/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:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.72+
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-bus
gyp ERR! node -v v12.19.0
gyp ERR! node-gyp -v v5.1.0
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-bus@1.2.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the i2c-bus@1.2.5 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-11-07T10_47_57_518Z-debug.log
As the upgrade was made to have the latest version of all possible pieces I would like not to be forced to downgrade nodejs but I'm not sure that's the issue. Any hints on that?
node v12.19.0
npm 6.14.8
Thanks