# Failed to install speakerpi

**URL:** <https://discourse.nodered.org/t/failed-to-install-speakerpi/17955>\
**Category:** General\
**Created:** [14 November 2019 13:05 UTC](https://discourse.nodered.org/t/failed-to-install-speakerpi/17955 "2019-11-14T13:05:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sid](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Sid](https://discourse.nodered.org/u/Sid)\
**Post date:** [14 November 2019 13:05 UTC](https://discourse.nodered.org/t/failed-to-install-speakerpi/17955/1 "2019-11-14T13:05:01Z")

</div>

Hi I want to install the node speakerpi.

I always get an error.

binding.target.mk:118: recept voor doel 'Release/obj.target/binding/src/binding.o' is mislukt  
make: \*\*\* [Release/obj.target/binding/src/binding.o] Fout 1  
make: Map '/home/pi/node\_modules/speaker/build' wordt verlaten  
gyp ERR! build error  
gyp ERR! stack Error: `make` failed with exit code: 2  
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node\_modules/npm/node\_modules/node-gyp/lib/build.js:194:23)  
gyp ERR! stack at ChildProcess.emit (events.js:210:5)  
gyp ERR! stack at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:272:12)  
gyp ERR! System Linux 4.19.66-v7+  
gyp ERR! command "/usr/bin/node" "/usr/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js" "rebuild"  
gyp ERR! cwd /home/pi/node\_modules/speaker  
gyp ERR! node -v v12.13.0  
gyp ERR! node-gyp -v v5.0.5  
gyp ERR! not ok  
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'  
npm WARN pi No description  
npm WARN pi No repository field.  
npm WARN pi No README data  
npm WARN pi No license field.  
npm ERR! code ELIFECYCLE  
npm ERR! errno 1  
npm ERR! speaker@0.4.2 install: `node-gyp rebuild`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the speaker@0.4.2 install script.  
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.  
npm ERR! A complete log of this run can be found in:  
npm ERR! /home/pi/.npm/\_logs/2019-11-14T12\_55\_20\_094Z-debug.log

I reinstalled rasbian and node already without succes.

Do I forget anything?

Thanks!

Sid

---

<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:** [14 November 2019 13:36 UTC](https://discourse.nodered.org/t/failed-to-install-speakerpi/17955/2 "2019-11-14T13:36:45Z")

</div>

Might be a node.js issue. You should probably open an issue on the node itself in GitHub

---

<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:** [14 November 2019 13:45 UTC](https://discourse.nodered.org/t/failed-to-install-speakerpi/17955/3 "2019-11-14T13:45:05Z")

</div>

You are installing in the wrong folder, you should be in your .node-red directory. So in a terminal run

```auto
cd .node-red
npm install node-red-contrib-speakerpi

```

If that doesn't work then post the full log here, including the install command.  
Also read the readme for the log which tells you how to install and specifies other requirements it needs.

---

<div class="post-metadata">

**Author:** ![Sid](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Sid](https://discourse.nodered.org/u/Sid)\
**Post date:** [14 November 2019 14:27 UTC](https://discourse.nodered.org/t/failed-to-install-speakerpi/17955/4 "2019-11-14T14:27:39Z")

</div>

Hi Colin,

I did it like you said, but I have still an error.

This are the last lines of the log.  
I'm sorry but I'm limited in the links I want to send and can't send an attachment because I'm a nex user ☹.

213 warn node-red-project@0.0.1 No repository field.  
214 warn node-red-project@0.0.1 No license field.  
215 verbose stack Error: speaker@0.4.2 install: `node-gyp rebuild`  
215 verbose stack Exit status 1  
215 verbose stack at EventEmitter. (/usr/lib/node\_modules/npm/node\_modules/npm-lifecycle/index.js:332:16)  
215 verbose stack at EventEmitter.emit (events.js:210:5)  
215 verbose stack at ChildProcess. (/usr/lib/node\_modules/npm/node\_modules/npm-lifecycle/lib/spawn.js:55:14)  
215 verbose stack at ChildProcess.emit (events.js:210:5)  
215 verbose stack at maybeClose (internal/child\_process.js:1021:16)  
215 verbose stack at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:283:5)  
216 verbose pkgid speaker@0.4.2  
217 verbose cwd /home/pi/.node-red  
218 verbose Linux 4.19.66-v7+  
219 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "node-red-contrib-speakerpi"  
220 verbose node v12.13.0  
221 verbose npm v6.13.0  
222 error code ELIFECYCLE  
223 error errno 1  
224 error speaker@0.4.2 install: `node-gyp rebuild`  
224 error Exit status 1  
225 error Failed at the speaker@0.4.2 install script.  
225 error This is probably not a problem with npm. There is likely additional logging output above.  
226 verbose exit [1, true]

Thx

---

<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:** [14 November 2019 15:07 UTC](https://discourse.nodered.org/t/failed-to-install-speakerpi/17955/5 "2019-11-14T15:07:40Z")

</div>

I think @zenofmud may be correct (not unusual), it may be a nodejs version 12 issue. I haven't got a system I can test that on at the moment. Probably best to post an issue on the node's github page. Perhaps someone who has a pi with node 12 could confirm this.

---

<div class="post-metadata">

**Author:** ![warnert](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/warnert/32/108132_2.png) [@warnert](https://discourse.nodered.org/u/warnert)\
**Post date:** [13 August 2020 06:05 UTC](https://discourse.nodered.org/t/failed-to-install-speakerpi/17955/6 "2020-08-13T06:05:41Z")

</div>

I try to install on my RB-pi and get this error:

```auto
2020-08-13T05:54:28.768Z Install : node-red-contrib-speakerpi 0.0.43

2020-08-13T05:54:29.180Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-speakerpi@0.0.43
2020-08-13T05:54:47.959Z [out] 
2020-08-13T05:54:47.959Z [out] > speaker@0.5.2 install /home/pi/.node-red/node_modules/speaker
2020-08-13T05:54:47.959Z [out] > node-gyp rebuild
2020-08-13T05:54:47.959Z [out] 
2020-08-13T05:54:50.559Z [out] make: Entering directory '/home/pi/.node-red/node_modules/speaker/build'
2020-08-13T05:54:50.567Z [out] CC(target) Release/obj.target/output/deps/mpg123/src/output/alsa.o
2020-08-13T05:54:51.569Z [err] ../deps/mpg123/src/output/alsa.c:19:10: fatal error: alsa/asoundlib.h: No such file or directory
2020-08-13T05:54:51.569Z [err] #include <alsa/asoundlib.h>
2020-08-13T05:54:51.569Z [err] ^ ~~~~~~~~~~~~~~~~~
2020-08-13T05:54:51.569Z [err] compilation terminated.
2020-08-13T05:54:51.600Z [err] make: *** [deps/mpg123/output.target.mk:124: Release/obj.target/output/deps/mpg123/src/output/alsa.o] Error 1
2020-08-13T05:54:51.600Z [out] make: Leaving directory '/home/pi/.node-red/node_modules/speaker/build'
2020-08-13T05:54:51.605Z [err] gyp
2020-08-13T05:54:51.605Z [err]  
2020-08-13T05:54:51.606Z [err] ERR! build error 
2020-08-13T05:54:51.608Z [err] gyp
2020-08-13T05:54:51.608Z [err] ERR! stack Error: `make` failed with exit code: 2
2020-08-13T05:54:51.608Z [err] gyp
2020-08-13T05:54:51.608Z [err] ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2020-08-13T05:54:51.609Z [err] gyp ERR! stack
2020-08-13T05:54:51.609Z [err] at ChildProcess.emit (events.js:310:20)
2020-08-13T05:54:51.609Z [err] gyp 
2020-08-13T05:54:51.609Z [err] ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
2020-08-13T05:54:51.610Z [err] gyp
2020-08-13T05:54:51.610Z [err] ERR! System Linux 4.19.97-v7+
2020-08-13T05:54:51.610Z [err] gyp ERR!
2020-08-13T05:54:51.611Z [err] command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-08-13T05:54:51.611Z [err] gyp ERR! 
2020-08-13T05:54:51.611Z [err] cwd /home/pi/.node-red/node_modules/speaker
2020-08-13T05:54:51.611Z [err] gyp
2020-08-13T05:54:51.611Z [err] ERR! node -v v12.16.3
2020-08-13T05:54:51.611Z [err] gyp ERR!
2020-08-13T05:54:51.611Z [err] node-gyp -v v5.1.0
2020-08-13T05:54:51.611Z [err] gyp
2020-08-13T05:54:51.612Z [err] ERR! not ok 
2020-08-13T05:54:52.211Z [err] npm
2020-08-13T05:54:52.211Z [err] WARN node-red-project@0.0.1 No repository field.
2020-08-13T05:54:52.211Z [err] npm WARN node-red-project@0.0.1 No license field.
2020-08-13T05:54:52.212Z [err] 
2020-08-13T05:54:53.696Z [err] npm
2020-08-13T05:54:53.697Z [err] ERR! code ELIFECYCLE
2020-08-13T05:54:53.697Z [err] npm ERR!
2020-08-13T05:54:53.697Z [err] errno 1
2020-08-13T05:54:53.698Z [err] npm
2020-08-13T05:54:53.698Z [err] ERR! speaker@0.5.2 install: `node-gyp rebuild`
2020-08-13T05:54:53.698Z [err] npm
2020-08-13T05:54:53.699Z [err] ERR! Exit status 1
2020-08-13T05:54:53.699Z [err] npm ERR!
2020-08-13T05:54:53.699Z [err]  
2020-08-13T05:54:53.699Z [err] npm 
2020-08-13T05:54:53.700Z [err] ERR! Failed at the speaker@0.5.2 install script.
2020-08-13T05:54:53.700Z [err] npm 
2020-08-13T05:54:53.700Z [err] ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-08-13T05:54:53.817Z [err] 
2020-08-13T05:54:53.818Z [err] npm ERR! A complete log of this run can be found in:
2020-08-13T05:54:53.818Z [err] npm 
2020-08-13T05:54:53.818Z [err] ERR! /home/pi/.npm/_logs/2020-08-13T05_54_53_722Z-debug.log
2020-08-13T05:54:53.851Z rc=1

```

and if I do sudo install alsa-utils it says:  
alsa-utils is already the newest version (1.1.8-2).  
alsa-utils set to manually installed.

All I want is to play a MP# file on the speaker output on an event. (play bell when someone pushes a button)

---

<div class="post-metadata">

**Author:** ![warnert](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/warnert/32/108132_2.png) [@warnert](https://discourse.nodered.org/u/warnert)\
**Post date:** [13 August 2020 06:48 UTC](https://discourse.nodered.org/t/failed-to-install-speakerpi/17955/7 "2020-08-13T06:48:19Z")

</div>

Sorry.  
I had to do a better search.

```auto
apt-get install libasound2-dev

```

did solve it.

---

<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:** [27 August 2020 06:48 UTC](https://discourse.nodered.org/t/failed-to-install-speakerpi/17955/8 "2020-08-27T06:48:20Z")

</div>

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