I can't install i2c module in rasberrypi (dietpi)

can't install i2c module in rasberrypi (dietpi), nodered 3.1.0
error log:

-----------------------------------------------------------
2023-10-19T12:28:29.580Z Install : node-red-contrib-i2c 0.9.0

2023-10-19T12:28:29.568Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-i2c@0.9.0
2023-10-19T12:28:31.939Z [err] npm
2023-10-19T12:28:31.943Z [err]  WARN config production Use `--omit=dev` instead.
2023-10-19T12:28:47.442Z [err] npm
2023-10-19T12:28:47.443Z [err]  
2023-10-19T12:28:47.447Z [err] ERR!
2023-10-19T12:28:47.453Z [err]  
2023-10-19T12:28:47.455Z [err] code
2023-10-19T12:28:47.456Z [err]  1
2023-10-19T12:28:47.459Z [err] npm
2023-10-19T12:28:47.462Z [err]  
2023-10-19T12:28:47.464Z [err] ERR!
2023-10-19T12:28:47.465Z [err]  
2023-10-19T12:28:47.467Z [err] path
2023-10-19T12:28:47.468Z [err]  /mnt/dietpi_userdata/node-red/node_modules/i2c-bus
2023-10-19T12:28:47.485Z [err] npm
2023-10-19T12:28:47.486Z [err]  
2023-10-19T12:28:47.487Z [err] ERR!
2023-10-19T12:28:47.489Z [err]  command failed
2023-10-19T12:28:47.491Z [err] npm
2023-10-19T12:28:47.492Z [err]  
2023-10-19T12:28:47.494Z [err] ERR!
2023-10-19T12:28:47.496Z [err]  
2023-10-19T12:28:47.497Z [err] command
2023-10-19T12:28:47.499Z [err]  sh -c node-gyp rebuild
2023-10-19T12:28:47.502Z [err] npm
2023-10-19T12:28:47.503Z [err]  
2023-10-19T12:28:47.504Z [err] ERR!
2023-10-19T12:28:47.506Z [err]  gyp info it worked if it ends with ok
2023-10-19T12:28:47.507Z [err] npm ERR! gyp info using node-gyp@9.4.0
2023-10-19T12:28:47.507Z [err] npm ERR! gyp info using node@21.0.0 | linux | arm64
2023-10-19T12:28:47.507Z [err] npm ERR!
2023-10-19T12:28:47.508Z [err]  gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
2023-10-19T12:28:47.508Z [err] npm 
2023-10-19T12:28:47.508Z [err] ERR! gyp info spawn /usr/bin/python3
2023-10-19T12:28:47.508Z [err] npm ERR!
2023-10-19T12:28:47.509Z [err]  gyp info spawn args [
2023-10-19T12:28:47.509Z [err] npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2023-10-19T12:28:47.509Z [err] npm
2023-10-19T12:28:47.510Z [err]  ERR! gyp info spawn args   'binding.gyp',
2023-10-19T12:28:47.510Z [err] npm ERR!
2023-10-19T12:28:47.510Z [err]  gyp info spawn args   '-f',
2023-10-19T12:28:47.510Z [err] npm ERR! gyp info spawn args   'make',
2023-10-19T12:28:47.510Z [err] npm ERR! gyp info spawn args   '-I',
2023-10-19T12:28:47.510Z [err] npm 
2023-10-19T12:28:47.511Z [err] ERR! gyp info spawn args   '/mnt/dietpi_userdata/node-red/node_modules/i2c-bus/build/config.gypi',
2023-10-19T12:28:47.511Z [err] npm 
2023-10-19T12:28:47.511Z [err] ERR! gyp info spawn args   '-I',
2023-10-19T12:28:47.511Z [err] npm ERR!
2023-10-19T12:28:47.512Z [err]  gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2023-10-19T12:28:47.512Z [err] npm ERR! gyp info spawn args   '-I',
2023-10-19T12:28:47.512Z [err] npm
2023-10-19T12:28:47.512Z [err]  ERR! gyp info spawn args   '/mnt/dietpi_userdata/node-red/.cache/node-gyp/21.0.0/include/node/common.gypi',
2023-10-19T12:28:47.512Z [err] npm ERR!
2023-10-19T12:28:47.513Z [err]  gyp info spawn args   '-Dlibrary=shared_library',
2023-10-19T12:28:47.513Z [err] npm ERR! gyp info spawn args   '-Dvisibility=default',
2023-10-19T12:28:47.513Z [err] npm
2023-10-19T12:28:47.514Z [err]  ERR! gyp info spawn args   '-Dnode_root_dir=/mnt/dietpi_userdata/node-red/.cache/node-gyp/21.0.0',
2023-10-19T12:28:47.514Z [err] npm ERR!
2023-10-19T12:28:47.514Z [err]  gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
2023-10-19T12:28:47.514Z [err] npm ERR!
2023-10-19T12:28:47.514Z [err]  gyp info spawn args   '-Dnode_lib_file=/mnt/dietpi_userdata/node-red/.cache/node-gyp/21.0.0/<(target_arch)/node.lib',
2023-10-19T12:28:47.514Z [err] npm ERR!
2023-10-19T12:28:47.515Z [err]  gyp info spawn args   '-Dmodule_root_dir=/mnt/dietpi_userdata/node-red/node_modules/i2c-bus',
2023-10-19T12:28:47.515Z [err] npm ERR!
2023-10-19T12:28:47.515Z [err]  gyp info spawn args   '-Dnode_engine=v8',
2023-10-19T12:28:47.515Z [err] npm 
2023-10-19T12:28:47.515Z [err] ERR! gyp info spawn args   '--depth=.',
2023-10-19T12:28:47.515Z [err] npm 
2023-10-19T12:28:47.515Z [err] ERR! gyp info spawn args   '--no-parallel',
2023-10-19T12:28:47.515Z [err] npm
2023-10-19T12:28:47.516Z [err]  ERR! gyp info spawn args   '--generator-output',
2023-10-19T12:28:47.516Z [err] npm ERR!
2023-10-19T12:28:47.516Z [err]  gyp info spawn args   'build',
2023-10-19T12:28:47.516Z [err] npm 
2023-10-19T12:28:47.516Z [err] ERR! gyp info spawn args   '-Goutput_dir=.'
2023-10-19T12:28:47.516Z [err] npm
2023-10-19T12:28:47.517Z [err]  ERR!
2023-10-19T12:28:47.518Z [err]  gyp info spawn args ]
2023-10-19T12:28:47.518Z [err] npm
2023-10-19T12:28:47.519Z [err]  ERR! gyp ERR! build error 
2023-10-19T12:28:47.519Z [err] npm ERR! gyp ERR! stack Error: not found: make
2023-10-19T12:28:47.519Z [err] npm 
2023-10-19T12:28:47.520Z [err] ERR! gyp ERR! stack     at getNotFoundError (/usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/which/which.js:10:17)
2023-10-19T12:28:47.520Z [err] npm ERR! gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/which/which.js:57:18
2023-10-19T12:28:47.520Z [err] npm
2023-10-19T12:28:47.520Z [err]  ERR! gyp ERR! stack     at new Promise (<anonymous>)
2023-10-19T12:28:47.520Z [err] npm ERR! gyp ERR! stack     at step (/usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/which/which.js:54:21)
2023-10-19T12:28:47.521Z [err] npm ERR! gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/which/which.js:71:22
2023-10-19T12:28:47.521Z [err] npm ERR!
2023-10-19T12:28:47.522Z [err]  gyp ERR! stack     at new Promise (<anonymous>)
2023-10-19T12:28:47.522Z [err] npm ERR! gyp ERR! stack     at subStep (/usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/which/which.js:69:33)
2023-10-19T12:28:47.522Z [err] npm
2023-10-19T12:28:47.522Z [err]  ERR! gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/which/which.js:80:22
2023-10-19T12:28:47.522Z [err] npm ERR! gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
2023-10-19T12:28:47.523Z [err] npm ERR! gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
2023-10-19T12:28:47.523Z [err] npm ERR! gyp ERR! System Linux 6.1.21-v8+
2023-10-19T12:28:47.523Z [err] npm 
2023-10-19T12:28:47.523Z [err] ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2023-10-19T12:28:47.523Z [err] npm ERR! gyp ERR! cwd /mnt/dietpi_userdata/node-red/node_modules/i2c-bus
2023-10-19T12:28:47.523Z [err] npm ERR!
2023-10-19T12:28:47.523Z [err]  gyp ERR! node -v v21.0.0
2023-10-19T12:28:47.523Z [err] npm ERR! gyp ERR! node-gyp -v v9.4.0
2023-10-19T12:28:47.523Z [err] npm 
2023-10-19T12:28:47.524Z [err] ERR! gyp ERR! not ok
2023-10-19T12:28:47.542Z [err] 
2023-10-19T12:28:47.543Z [err] npm 
2023-10-19T12:28:47.544Z [err] ERR! A complete log of this run can be found in: /mnt/dietpi_userdata/node-red/.npm/_logs/2023-10-19T12_28_31_437Z-debug-0.log
2023-10-19T12:28:47.592Z rc=1

Please tell me you have read the error log?

if not here is your clue - install your environment build-tools

1 Like

looks like you need to install make

1 Like

You need to install the build tools, including make.

1 Like

working! thanks for all

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.