Problem installing with npm the I2C modules - MCP23017

Hi there.

I'm trying to install the palette node-red-contrib-mcp23017 in Node-Red.

What it returns to me is just errors both installing via Node-Red or using the npm mode in the .node-red directory.

I followed all the instructions written in the prerequisites in this page https://flows.nodered.org/node/node-red-contrib-mcp23017

I installed the Node.js and then when I typed the command npm install node-mcp23017 --save it return to me the following error:

i2c.target.mk:99: recipe for target 'Release/obj.target/i2c/src/i2c.o' failed
make: *** [Release/obj.target/i2c/src/i2c.o] Error 1
make: Leaving directory '/home/pi/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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:193:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:255:12)
gyp ERR! System Linux 4.19.32-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_modules/i2c
gyp ERR! node -v v11.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi 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/2019-04-07T11_00_04_905Z-debug.log

I get this error for any kind on intallation for the I2C modules.
Instead if I use the terminal to see the devices connected I can see them easily typing i2cdetect -y 1.
I can't understand how to solve this problem to install this palette.

Anyone could please help me?

Thanks a lot.
Mattia

You are using nodejs v11, many third party libraries especially ones that need to be compiled won’t yet work with it.

Try installing nodejs v10 LTS (which is the recommended version for Node-RED anyway) and try again.

In fact if you are on a Pi then you are probably best to use the install script below, which will install compatible versions of everything.

Thanks @ukmoose and @Colin

I installed the nodejs v10 with

curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs

Unfortunately didn't change anything and still get this error below. I installed at the beginning Node-Red with the script provided on the node-red website and then just made apt-get update and apt-get upgrade

Should I chaange something? I'm using NPM directly into the folder node-red but I can't make it work.

i2c.target.mk:99: recipe for target 'Release/obj.target/i2c/src/i2c.o' failed
make: *** [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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.19.32-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 v10.15.3
gyp ERR! node-gyp -v v3.8.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@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/2019-04-07T12_40_14_264Z-debug.log

Thanks for you help!

I see this has been reported, but I don't understand the comments about it.
What OS are you using on the pi?

@Colin I'm running a Raspbian Stretch Lite on my Pi
I already had a look mostly around internet but couldn't find anything that helped me out to solve this problem.
Thanks

I suggest asking on that node's github.