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

**URL:** <https://discourse.nodered.org/t/i-cant-install-i2c-module-in-rasberrypi-dietpi/82187>\
**Category:** General\
**Created:** [19 October 2023 12:38 UTC](https://discourse.nodered.org/t/i-cant-install-i2c-module-in-rasberrypi-dietpi/82187 "2023-10-19T12:38:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kliurka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kliurka/32/79969_2.png) [@Kliurka](https://discourse.nodered.org/u/Kliurka)\
**Post date:** [19 October 2023 12:38 UTC](https://discourse.nodered.org/t/i-cant-install-i2c-module-in-rasberrypi-dietpi/82187/1 "2023-10-19T12:38:14Z")

</div>

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

```auto
-----------------------------------------------------------
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

```

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [19 October 2023 12:42 UTC](https://discourse.nodered.org/t/i-cant-install-i2c-module-in-rasberrypi-dietpi/82187/2 "2023-10-19T12:42:11Z")

</div>

Please tell me you have read the error log?

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

> [@Kliurka](#):
>
> `2023-10-19T12:28:47.519Z [err] npm ERR! gyp ERR! stack Error: not found: make`

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 October 2023 12:42 UTC](https://discourse.nodered.org/t/i-cant-install-i2c-module-in-rasberrypi-dietpi/82187/3 "2023-10-19T12:42:36Z")

</div>

> [@Kliurka](#):
>
> `npm ERR! gyp ERR! stack Error: not found: make`

looks like you need to install `make`

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 October 2023 12:51 UTC](https://discourse.nodered.org/t/i-cant-install-i2c-module-in-rasberrypi-dietpi/82187/4 "2023-10-19T12:51:13Z")

</div>

> [@Kliurka](#):
>
> ```auto
> npm ERR! gyp ERR! stack Error: not found: make
> 
> ```

You need to install the build tools, including make.

---

<div class="post-metadata">

**Author:** ![Kliurka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kliurka/32/79969_2.png) [@Kliurka](https://discourse.nodered.org/u/Kliurka)\
**Post date:** [19 October 2023 12:55 UTC](https://discourse.nodered.org/t/i-cant-install-i2c-module-in-rasberrypi-dietpi/82187/5 "2023-10-19T12:55:52Z")

</div>

working! thanks for all

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 November 2023 12:56 UTC](https://discourse.nodered.org/t/i-cant-install-i2c-module-in-rasberrypi-dietpi/82187/6 "2023-11-02T12:56:21Z")

</div>

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