node-red-contrib-i2c icon indicating copy to clipboard operation
node-red-contrib-i2c copied to clipboard

install problem

Open UserBRMFC opened this issue 3 years ago • 4 comments

I get an error when I try to load this node via manage pallete, this is the log :

2022-11-03T14:43:21.800Z Install : node-red-contrib-i2c 0.9.0

2022-11-03T14:43:21.966Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected] 2022-11-03T14:43:23.731Z [err] npm 2022-11-03T14:43:23.732Z [err] WARN 2022-11-03T14:43:23.732Z [err] config production Use --omit=dev instead. 2022-11-03T14:43:27.702Z [err] npm 2022-11-03T14:43:27.703Z [err] ERR! 2022-11-03T14:43:27.703Z [err] code 1 2022-11-03T14:43:27.703Z [err] npm ERR! 2022-11-03T14:43:27.703Z [err] path 2022-11-03T14:43:27.704Z [err] /config/node-red/node_modules/i2c-bus 2022-11-03T14:43:27.710Z [err] npm 2022-11-03T14:43:27.710Z [err] ERR! command failed 2022-11-03T14:43:27.710Z [err] npm 2022-11-03T14:43:27.711Z [err] ERR! command sh -c node-gyp rebuild 2022-11-03T14:43:27.711Z [err] npm ERR! 2022-11-03T14:43:27.712Z [err] gyp info it worked if it ends with ok 2022-11-03T14:43:27.712Z [err] npm ERR! 2022-11-03T14:43:27.712Z [err] gyp info using [email protected] 2022-11-03T14:43:27.712Z [err] npm ERR! gyp info using [email protected] | linux | arm64 2022-11-03T14:43:27.712Z [err] npm ERR! 2022-11-03T14:43:27.712Z [err] gyp ERR! find Python 2022-11-03T14:43:27.712Z [err] npm 2022-11-03T14:43:27.712Z [err] ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration 2022-11-03T14:43:27.712Z [err] npm 2022-11-03T14:43:27.713Z [err] ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/bin/python3" 2022-11-03T14:43:27.713Z [err] npm ERR! 2022-11-03T14:43:27.713Z [err] gyp ERR! find Python - "/usr/bin/python3" is not in PATH or produced an error 2022-11-03T14:43:27.713Z [err] npm ERR! 2022-11-03T14:43:27.713Z [err] gyp ERR! find Python Python is not set from environment variable PYTHON 2022-11-03T14:43:27.713Z [err] npm ERR! gyp ERR! find Python checking if "python3" can be used 2022-11-03T14:43:27.713Z [err] npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error 2022-11-03T14:43:27.713Z [err] npm 2022-11-03T14:43:27.714Z [err] ERR! gyp ERR! find Python checking if "python" can be used 2022-11-03T14:43:27.714Z [err] npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error 2022-11-03T14:43:27.714Z [err] npm ERR! gyp ERR! find Python 2022-11-03T14:43:27.714Z [err] npm ERR! gyp ERR! find Python ********************************************************** 2022-11-03T14:43:27.714Z [err] npm ERR! 2022-11-03T14:43:27.714Z [err] gyp ERR! find Python You need to install the latest version of Python. 2022-11-03T14:43:27.714Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not, 2022-11-03T14:43:27.714Z [err] npm ERR! gyp ERR! find Python you can try one of the following options: 2022-11-03T14:43:27.714Z [err] npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable" 2022-11-03T14:43:27.714Z [err] npm 2022-11-03T14:43:27.714Z [err] ERR! gyp ERR! find Python (accepted by both node-gyp and npm) 2022-11-03T14:43:27.714Z [err] npm ERR! 2022-11-03T14:43:27.714Z [err] gyp ERR! find Python - Set the environment variable PYTHON 2022-11-03T14:43:27.714Z [err] npm ERR! 2022-11-03T14:43:27.714Z [err] gyp ERR! find Python - Set the npm configuration variable python: 2022-11-03T14:43:27.714Z [err] npm ERR! gyp ERR! find Python npm config set python "/path/to/pythonexecutable" 2022-11-03T14:43:27.714Z [err] npm ERR! gyp ERR! find Python For more information consult the documentation at: 2022-11-03T14:43:27.714Z [err] npm 2022-11-03T14:43:27.715Z [err] ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation 2022-11-03T14:43:27.715Z [err] npm ERR! 2022-11-03T14:43:27.715Z [err] gyp ERR! find Python ********************************************************** 2022-11-03T14:43:27.715Z [err] npm ERR! 2022-11-03T14:43:27.715Z [err] gyp ERR! find Python 2022-11-03T14:43:27.715Z [err] npm ERR! gyp ERR! configure error 2022-11-03T14:43:27.715Z [err] npm ERR! gyp ERR! stack Error: Could not find any Python installation to use 2022-11-03T14:43:27.715Z [err] npm ERR! gyp ERR! stack at PythonFinder.fail (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47) 2022-11-03T14:43:27.715Z [err] npm 2022-11-03T14:43:27.715Z [err] ERR! gyp ERR! stack at PythonFinder.runChecks (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21) 2022-11-03T14:43:27.715Z [err] npm 2022-11-03T14:43:27.715Z [err] ERR! gyp ERR! stack at PythonFinder. (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16) 2022-11-03T14:43:27.715Z [err] npm 2022-11-03T14:43:27.715Z [err] ERR! gyp ERR! stack at PythonFinder.execFileCallback (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16) 2022-11-03T14:43:27.715Z [err] npm ERR! 2022-11-03T14:43:27.716Z [err] gyp ERR! stack at exithandler (node:child_process:408:5) 2022-11-03T14:43:27.716Z [err] npm ERR! 2022-11-03T14:43:27.716Z [err] gyp ERR! stack at ChildProcess.errorhandler (node:child_process:420:5) 2022-11-03T14:43:27.716Z [err] npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) 2022-11-03T14:43:27.716Z [err] npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12) 2022-11-03T14:43:27.716Z [err] npm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:478:16) 2022-11-03T14:43:27.716Z [err] npm 2022-11-03T14:43:27.716Z [err] ERR! gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21) 2022-11-03T14:43:27.716Z [err] npm 2022-11-03T14:43:27.716Z [err] ERR! gyp ERR! System Linux 5.15.61-v8 2022-11-03T14:43:27.716Z [err] npm ERR! 2022-11-03T14:43:27.716Z [err] gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 2022-11-03T14:43:27.716Z [err] npm ERR! 2022-11-03T14:43:27.716Z [err] gyp ERR! cwd /config/node-red/node_modules/i2c-bus 2022-11-03T14:43:27.716Z [err] npm ERR! gyp ERR! node -v v16.17.1 2022-11-03T14:43:27.717Z [err] npm ERR! gyp ERR! node-gyp -v v9.0.0 2022-11-03T14:43:27.717Z [err] npm ERR! gyp ERR! not ok 2022-11-03T14:43:27.726Z [err] 2022-11-03T14:43:27.726Z [err] npm ERR! 2022-11-03T14:43:27.726Z [err] A complete log of this run can be found in: 2022-11-03T14:43:27.726Z [err] npm ERR! /root/.npm/_logs/2022-11-03T14_43_23_581Z-debug-0.log 2022-11-03T14:43:27.746Z rc=1

UserBRMFC avatar Nov 03 '22 14:11 UserBRMFC

As several of the error message hint at - the process can't find python installed on your machine. This is often an indication that you don't have the necessary build tools installed. You don't mention what OS you are using but for linux you would usually install the build-essentials package

dceejay avatar Nov 03 '22 15:11 dceejay

OS is Home assistant

UserBRMFC avatar Nov 03 '22 18:11 UserBRMFC

I don't use that at all - may be better asking o their forum how to install the build tools.

dceejay avatar Nov 04 '22 09:11 dceejay

I tried to install on node red 3.2.1 on Raspberry Pi (bullseye), I get following:

2023-12-04T19:40:56.792Z Install : node-red-contrib-i2c 0.9.0

2023-12-04T19:41:00.627Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2023-12-04T19:41:02.637Z [err] npm
2023-12-04T19:41:02.639Z [err]  WARN
2023-12-04T19:41:02.639Z [err]  config production Use `--omit=dev` instead.
2023-12-04T19:41:10.243Z [err] npm
2023-12-04T19:41:10.243Z [err]  ERR!
2023-12-04T19:41:10.244Z [err]  code
2023-12-04T19:41:10.244Z [err]  1
2023-12-04T19:41:10.245Z [err] npm
2023-12-04T19:41:10.245Z [err]  
2023-12-04T19:41:10.245Z [err] ERR!
2023-12-04T19:41:10.245Z [err]  path
2023-12-04T19:41:10.246Z [err]  /home/pi/.node-red/node_modules/i2c-bus
2023-12-04T19:41:10.252Z [err] npm 
2023-12-04T19:41:10.252Z [err] ERR! command failed
2023-12-04T19:41:10.252Z [err] npm ERR! command
2023-12-04T19:41:10.252Z [err]  sh -c node-gyp rebuild
2023-12-04T19:41:10.253Z [err] npm 
2023-12-04T19:41:10.253Z [err] ERR! make: Entering directory '/home/pi/.node-red/node_modules/i2c-bus/build'
2023-12-04T19:41:10.253Z [err] npm ERR!
2023-12-04T19:41:10.253Z [err]    CXX(target) Release/obj.target/i2c/src/i2c.o
2023-12-04T19:41:10.253Z [err] npm ERR!
2023-12-04T19:41:10.253Z [err]  make: Leaving directory '/home/pi/.node-red/node_modules/i2c-bus/build'
2023-12-04T19:41:10.254Z [err] npm 
2023-12-04T19:41:10.254Z [err] ERR! gyp info it worked if it ends with ok
2023-12-04T19:41:10.255Z [err] npm 
2023-12-04T19:41:10.255Z [err] ERR! gyp info using [email protected]
2023-12-04T19:41:10.255Z [err] npm 
2023-12-04T19:41:10.255Z [err] ERR! gyp info using [email protected] | linux | arm
2023-12-04T19:41:10.255Z [err] npm 
2023-12-04T19:41:10.255Z [err] ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
2023-12-04T19:41:10.255Z [err] npm 
2023-12-04T19:41:10.255Z [err] ERR! gyp info spawn /usr/bin/python3
2023-12-04T19:41:10.255Z [err] npm 
2023-12-04T19:41:10.255Z [err] ERR! gyp info spawn args [
2023-12-04T19:41:10.255Z [err] npm
2023-12-04T19:41:10.255Z [err]  ERR! gyp info spawn args   '/home/pi/node_modules/node-gyp/gyp/gyp_main.py',
2023-12-04T19:41:10.255Z [err] npm ERR!
2023-12-04T19:41:10.256Z [err]  gyp info spawn args   'binding.gyp',
2023-12-04T19:41:10.256Z [err] npm ERR!
2023-12-04T19:41:10.256Z [err]  gyp info spawn args   '-f',
2023-12-04T19:41:10.256Z [err] npm 
2023-12-04T19:41:10.256Z [err] ERR! gyp info spawn args   'make',
2023-12-04T19:41:10.256Z [err] npm 
2023-12-04T19:41:10.256Z [err] ERR! gyp info spawn args   '-I',
2023-12-04T19:41:10.256Z [err] npm 
2023-12-04T19:41:10.256Z [err] ERR! gyp info spawn args   '/home/pi/.node-red/node_modules/i2c-bus/build/config.gypi',
2023-12-04T19:41:10.256Z [err] npm
2023-12-04T19:41:10.256Z [err]  ERR! gyp info spawn args   '-I',
2023-12-04T19:41:10.256Z [err] npm ERR! gyp info spawn args   '/home/pi/node_modules/node-gyp/addon.gypi',
2023-12-04T19:41:10.256Z [err] npm ERR!
2023-12-04T19:41:10.256Z [err]  gyp info spawn args   '-I',
2023-12-04T19:41:10.256Z [err] npm ERR!
2023-12-04T19:41:10.257Z [err]  gyp info spawn args   '/home/pi/.cache/node-gyp/20.9.0/include/node/common.gypi',
2023-12-04T19:41:10.257Z [err] npm ERR!
2023-12-04T19:41:10.257Z [err]  gyp info spawn args   '-Dlibrary=shared_library',
2023-12-04T19:41:10.257Z [err] npm 
2023-12-04T19:41:10.257Z [err] ERR! gyp info spawn args   '-Dvisibility=default',
2023-12-04T19:41:10.257Z [err] npm
2023-12-04T19:41:10.257Z [err]  ERR! gyp info spawn args   '-Dnode_root_dir=/home/pi/.cache/node-gyp/20.9.0',
2023-12-04T19:41:10.257Z [err] npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/pi/node_modules/node-gyp',
2023-12-04T19:41:10.257Z [err] npm ERR!
2023-12-04T19:41:10.257Z [err]  gyp info spawn args   '-Dnode_lib_file=/home/pi/.cache/node-gyp/20.9.0/<(target_arch)/node.lib',
2023-12-04T19:41:10.257Z [err] npm ERR!
2023-12-04T19:41:10.257Z [err]  gyp info spawn args   '-Dmodule_root_dir=/home/pi/.node-red/node_modules/i2c-bus',
2023-12-04T19:41:10.257Z [err] npm ERR!
2023-12-04T19:41:10.257Z [err]  gyp info spawn args   '-Dnode_engine=v8',
2023-12-04T19:41:10.257Z [err] npm 
2023-12-04T19:41:10.258Z [err] ERR! gyp info spawn args   '--depth=.',
2023-12-04T19:41:10.258Z [err] npm 
2023-12-04T19:41:10.258Z [err] ERR! gyp info spawn args   '--no-parallel',
2023-12-04T19:41:10.258Z [err] npm
2023-12-04T19:41:10.258Z [err]  ERR! gyp info spawn args   '--generator-output',
2023-12-04T19:41:10.258Z [err] npm
2023-12-04T19:41:10.258Z [err]  ERR! gyp info spawn args   'build',
2023-12-04T19:41:10.258Z [err] npm ERR!
2023-12-04T19:41:10.258Z [err]  gyp info spawn args   '-Goutput_dir=.'
2023-12-04T19:41:10.258Z [err] npm ERR!
2023-12-04T19:41:10.258Z [err]  gyp info spawn args ]
2023-12-04T19:41:10.258Z [err] npm ERR!
2023-12-04T19:41:10.258Z [err]  gyp info spawn make
2023-12-04T19:41:10.258Z [err] npm 
2023-12-04T19:41:10.258Z [err] ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
2023-12-04T19:41:10.258Z [err] npm
2023-12-04T19:41:10.259Z [err]  ERR! make: g++: No such file or directory
2023-12-04T19:41:10.259Z [err] npm
2023-12-04T19:41:10.259Z [err]  ERR! make: *** [i2c.target.mk:115: Release/obj.target/i2c/src/i2c.o] Error 127
2023-12-04T19:41:10.259Z [err] npm
2023-12-04T19:41:10.259Z [err]  ERR! gyp ERR! build error 
2023-12-04T19:41:10.259Z [err] npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
2023-12-04T19:41:10.259Z [err] npm ERR!
2023-12-04T19:41:10.259Z [err]  gyp ERR! stack     at ChildProcess.onExit (/home/pi/node_modules/node-gyp/lib/build.js:194:23)
2023-12-04T19:41:10.259Z [err] npm 
2023-12-04T19:41:10.259Z [err] ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
2023-12-04T19:41:10.259Z [err] npm 
2023-12-04T19:41:10.259Z [err] ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
2023-12-04T19:41:10.259Z [err] npm
2023-12-04T19:41:10.259Z [err]  ERR! gyp ERR! System Linux 6.1.63-v7+
2023-12-04T19:41:10.260Z [err] npm ERR!
2023-12-04T19:41:10.260Z [err]  gyp ERR! command "/usr/local/bin/node" "/home/pi/node_modules/.bin/node-gyp" "rebuild"
2023-12-04T19:41:10.260Z [err] npm ERR!
2023-12-04T19:41:10.260Z [err]  gyp ERR! cwd /home/pi/.node-red/node_modules/i2c-bus
2023-12-04T19:41:10.260Z [err] npm ERR!
2023-12-04T19:41:10.260Z [err]  gyp ERR! node -v v20.9.0
2023-12-04T19:41:10.260Z [err] npm 
2023-12-04T19:41:10.260Z [err] ERR! gyp ERR! node-gyp -v v8.4.1
2023-12-04T19:41:10.260Z [err] npm
2023-12-04T19:41:10.260Z [err]  ERR! gyp ERR! not ok
2023-12-04T19:41:10.270Z [err] 
2023-12-04T19:41:10.270Z [err] npm 
2023-12-04T19:41:10.270Z [err] ERR! A complete log of this run can be found in: /home/pi/.npm/_logs/2023-12-04T19_41_02_445Z-debug-0.log
2023-12-04T19:41:10.294Z rc=1

t0r0 avatar Dec 04 '23 19:12 t0r0