node-red-contrib-i2c
node-red-contrib-i2c copied to clipboard
Installation on Raspberry Pi 4 fails
Here is the last part of the log where the install fails. I can't install through node red and I can't even install it at the command line:
144 info lifecycle [email protected]~install: [email protected]
145 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle true
146 verbose lifecycle [email protected]~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/lib/node_modules/node-red-contrib-i2c/node_modules/i2c-bus/node_modules/.bin:/usr/lib/node_modules/node-red-contrib-i2c/node_modules/.bin:/usr/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
147 verbose lifecycle [email protected]~install: CWD: /usr/lib/node_modules/node-red-contrib-i2c/node_modules/i2c-bus
148 silly lifecycle [email protected]~install: Args: [ '-c', 'node-gyp rebuild' ]
149 silly lifecycle [email protected]~install: Returned: code: 1 signal: null
150 info lifecycle [email protected]~install: Failed to exec install script
151 timing action:install Completed in 2374ms
152 verbose unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
153 timing stage:rollbackFailedOptional Completed in 69ms
154 timing stage:runTopLevelLifecycles Completed in 3161ms
155 verbose stack Error: [email protected] install: `node-gyp rebuild`
155 verbose stack Exit status 1
155 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
155 verbose stack at EventEmitter.emit (events.js:311:20)
155 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
155 verbose stack at ChildProcess.emit (events.js:311:20)
155 verbose stack at maybeClose (internal/child_process.js:1021:16)
155 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
156 verbose pkgid [email protected]
157 verbose cwd /root
158 verbose Linux 4.19.108-v7l+
159 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "--unsafe-perm" "node-red-contrib-i2c"
160 verbose node v12.16.1
161 verbose npm v6.14.3
162 error code ELIFECYCLE
163 error errno 1
164 error [email protected] install: `node-gyp rebuild`
164 error Exit status 1
165 error Failed at the [email protected] install script.
165 error This is probably not a problem with npm. There is likely additional logging output above.
166 verbose exit [ 1, true ]
Anyone have an ideas?
be sure you are installing node red and modules from NO root account. If you had, then is better you remove all and reinstall from NO root
I am installing as root, but that's because I wanted to run certain processes with the "exec" node and I didn't want to run into permissions issues... but either way, that shouldn't have effect on installing this package, should it?
Unfortunately installing under root put the package in a different folder, that is what I noticed, I can't tell you more. You better read and ask on nodered forum
Went back and redid the entire install under the pi user... same error message.
Just a foot note, you can always use 'sudo' with an exec node to avoid running Node Red under root. Are you using the official installation script for Node Red installation? I have several Pi 4 devices running Node Red without issue, including use of the 'node-red-contrib-i2c-bus' library. The original 'node-red-contrib-i2c' library is very dated, not actively supported, and I have yet to try to fix it or resolve the build errors 'i2c' has, given 'i2c-bus' works fine.