# Node-red-contrib-speakerpi fails to install

**URL:** <https://discourse.nodered.org/t/node-red-contrib-speakerpi-fails-to-install/73641>\
**Category:** General\
**Created:** [13 January 2023 14:23 UTC](https://discourse.nodered.org/t/node-red-contrib-speakerpi-fails-to-install/73641 "2023-01-13T14:23:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![P\_S](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@P\_S](https://discourse.nodered.org/u/P_S)\
**Post date:** [13 January 2023 14:23 UTC](https://discourse.nodered.org/t/node-red-contrib-speakerpi-fails-to-install/73641/1 "2023-01-13T14:23:35Z")

</div>

I tried to install this, but it constantly fails.  
I have two Raspbery PI boards: RPi 1.1 and RPi 3b  
For the RPi1.1 I used the following OS'es

- Raspberry Pi OS Lite 32 bit Bullseye 2022-09-22
- Raspberry Pi OS Full 32 Bullseye 2022-09-22

and with the RPi 3b I tried

- Raspberry Pi OS Full 64 bit Bullseye 2022-09-22
- Openhabian 3.4.1

Every single time I try to instsall speakerpi from the "Manage palette" window or from shell ./node-red -folder I get a bunch load of error messages. This has happened every single time with all of the RPi's and OS's I've tried. I'm believe I have installed all dependencies.

Error messages:

```auto
2023-01-13T14:17:36.402Z Install : node-red-contrib-speakerpi 0.0.43

2023-01-13T14:17:36.472Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-speakerpi@0.0.43
2023-01-13T14:17:38.438Z [err] npm
2023-01-13T14:17:38.440Z [err] WARN
2023-01-13T14:17:38.440Z [err] config production Use `--omit=dev` instead.
2023-01-13T14:17:45.991Z [err] npm
2023-01-13T14:17:45.992Z [err] ERR! 
2023-01-13T14:17:45.993Z [err] code
2023-01-13T14:17:45.993Z [err] 1
2023-01-13T14:17:45.994Z [err] npm ERR!
2023-01-13T14:17:45.994Z [err] path /home/openhabian/.node-red/node_modules/speaker
2023-01-13T14:17:46.002Z [err] npm ERR!
2023-01-13T14:17:46.002Z [err] command failed
2023-01-13T14:17:46.002Z [err] npm ERR!
2023-01-13T14:17:46.002Z [err]  
2023-01-13T14:17:46.003Z [err] command sh -c -- node-gyp rebuild
2023-01-13T14:17:46.004Z [err] npm ERR!
2023-01-13T14:17:46.004Z [err] gyp info it worked if it ends with ok
2023-01-13T14:17:46.004Z [err] npm ERR! gyp info using node-gyp@9.1.0
2023-01-13T14:17:46.004Z [err] npm ERR! gyp info using node@16.19.0 | linux | arm64
2023-01-13T14:17:46.004Z [err] npm 
2023-01-13T14:17:46.005Z [err] ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
2023-01-13T14:17:46.005Z [err] npm ERR!
2023-01-13T14:17:46.005Z [err] gyp info spawn /usr/bin/python3
2023-01-13T14:17:46.005Z [err] npm ERR!
2023-01-13T14:17:46.005Z [err] gyp info spawn args [
2023-01-13T14:17:46.005Z [err] npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2023-01-13T14:17:46.005Z [err] npm
2023-01-13T14:17:46.005Z [err] ERR! gyp info spawn args 'binding.gyp',
2023-01-13T14:17:46.005Z [err] npm ERR!
2023-01-13T14:17:46.005Z [err] gyp info spawn args '-f',
2023-01-13T14:17:46.005Z [err] npm ERR!
2023-01-13T14:17:46.006Z [err] gyp info spawn args 'make',
2023-01-13T14:17:46.006Z [err] npm ERR! gyp info spawn args '-I',
2023-01-13T14:17:46.006Z [err] npm
2023-01-13T14:17:46.006Z [err] ERR! gyp info spawn args '/home/openhabian/.node-red/node_modules/speaker/build/config.gypi',
2023-01-13T14:17:46.006Z [err] npm ERR!
2023-01-13T14:17:46.006Z [err] gyp info spawn args '-I',
2023-01-13T14:17:46.006Z [err] npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2023-01-13T14:17:46.006Z [err] npm ERR! gyp info spawn args '-I',
2023-01-13T14:17:46.006Z [err] npm
2023-01-13T14:17:46.006Z [err] ERR! gyp info spawn args '/home/openhabian/.cache/node-gyp/16.19.0/include/node/common.gypi',
2023-01-13T14:17:46.006Z [err] npm 
2023-01-13T14:17:46.007Z [err] ERR! gyp info spawn args '-Dlibrary=shared_library',
2023-01-13T14:17:46.007Z [err] npm ERR!
2023-01-13T14:17:46.007Z [err] gyp info spawn args '-Dvisibility=default',
2023-01-13T14:17:46.007Z [err] npm ERR! gyp info spawn args '-Dnode_root_dir=/home/openhabian/.cache/node-gyp/16.19.0',
2023-01-13T14:17:46.007Z [err] npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
2023-01-13T14:17:46.007Z [err] npm
2023-01-13T14:17:46.007Z [err] ERR! gyp info spawn args '-Dnode_lib_file=/home/openhabian/.cache/node-gyp/16.19.0/<(target_arch)/node.lib',
2023-01-13T14:17:46.007Z [err] npm ERR!
2023-01-13T14:17:46.007Z [err] gyp info spawn args '-Dmodule_root_dir=/home/openhabian/.node-red/node_modules/speaker',
2023-01-13T14:17:46.007Z [err] npm ERR! gyp info spawn args '-Dnode_engine=v8',
2023-01-13T14:17:46.007Z [err] npm ERR!
2023-01-13T14:17:46.008Z [err] gyp info spawn args '--depth=.',
2023-01-13T14:17:46.008Z [err] npm ERR! gyp info spawn args '--no-parallel',
2023-01-13T14:17:46.008Z [err] npm ERR! gyp info spawn args '--generator-output',
2023-01-13T14:17:46.008Z [err] npm 
2023-01-13T14:17:46.008Z [err] ERR! gyp info spawn args 'build',
2023-01-13T14:17:46.008Z [err] npm ERR!
2023-01-13T14:17:46.008Z [err] gyp info spawn args '-Goutput_dir=.'
2023-01-13T14:17:46.008Z [err] npm ERR!
2023-01-13T14:17:46.008Z [err] gyp info spawn args ]
2023-01-13T14:17:46.008Z [err] npm ERR! gyp: name 'mpg123_cpu' is not defined while evaluating condition 'mpg123_cpu=="arm_nofpu"' in deps/mpg123/mpg123.gyp while loading dependencies of binding.gyp while trying to load binding.gyp
2023-01-13T14:17:46.009Z [err] npm ERR! gyp ERR! configure error 
2023-01-13T14:17:46.009Z [err] npm 
2023-01-13T14:17:46.009Z [err] ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
2023-01-13T14:17:46.009Z [err] npm ERR!
2023-01-13T14:17:46.009Z [err] gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:284:16)
2023-01-13T14:17:46.009Z [err] npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
2023-01-13T14:17:46.009Z [err] npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
2023-01-13T14:17:46.009Z [err] npm
2023-01-13T14:17:46.009Z [err] ERR! gyp ERR! System Linux 5.15.84-v8+
2023-01-13T14:17:46.009Z [err] npm 
2023-01-13T14:17:46.009Z [err] ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2023-01-13T14:17:46.009Z [err] npm ERR!
2023-01-13T14:17:46.010Z [err] gyp ERR! cwd /home/openhabian/.node-red/node_modules/speaker
2023-01-13T14:17:46.010Z [err] npm ERR!
2023-01-13T14:17:46.010Z [err] gyp ERR! node -v v16.19.0
2023-01-13T14:17:46.010Z [err] npm ERR! gyp ERR! node-gyp -v v9.1.0
2023-01-13T14:17:46.010Z [err] npm ERR! gyp ERR! not ok
2023-01-13T14:17:46.019Z [err] 
2023-01-13T14:17:46.020Z [err] npm ERR!
2023-01-13T14:17:46.020Z [err] A complete log of this run can be found in:
2023-01-13T14:17:46.020Z [err] npm ERR! /home/openhabian/.npm/_logs/2023-01-13T14_17_38_272Z-debug-0.log
2023-01-13T14:17:46.053Z rc=1

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [13 January 2023 15:39 UTC](https://discourse.nodered.org/t/node-red-contrib-speakerpi-fails-to-install/73641/2 "2023-01-13T15:39:02Z")

</div>

> [@P\_S](#):
>
> I'm believe I have installed all dependencies

Did you install [pre-requisites](https://flows.nodered.org/node/node-red-contrib-speakerpi)

> ### Additionally you have to install on the Raspberry Pi
> 
> ```auto
> sudo apt-get install libasound2-dev
> 
> ```

---

<div class="post-metadata">

**Author:** ![P\_S](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@P\_S](https://discourse.nodered.org/u/P_S)\
**Post date:** [13 January 2023 16:18 UTC](https://discourse.nodered.org/t/node-red-contrib-speakerpi-fails-to-install/73641/3 "2023-01-13T16:18:07Z")

</div>

Yes, I did install libasound2-dev as instructed before trying to install the speakerpi.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [13 January 2023 16:24 UTC](https://discourse.nodered.org/t/node-red-contrib-speakerpi-fails-to-install/73641/4 "2023-01-13T16:24:52Z")

</div>

then you will have to read through the issues on [node-red-contrib-speakerpi](https://github.com/O-Hahn/node-red-contrib-speakerpi/issues) and the underlying [speaker](https://github.com/TooTallNate/node-speaker/issues?q=mpg123_cpu) package where you will find several users with the exact same issue - may be some clues in there.

search for `mpg123_cpu`

---

<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:** [14 March 2023 16:25 UTC](https://discourse.nodered.org/t/node-red-contrib-speakerpi-fails-to-install/73641/5 "2023-03-14T16:25:03Z")

</div>

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