Failed to install speakerpi

Hi I want to install the node speakerpi.

I always get an error. recept voor doel 'Release/' is mislukt
make: *** [Release/] 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! 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?



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

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

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.

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 :frowning:.

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 ]


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.

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

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/
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/ Release/] 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)

I had to do a better search.

apt-get install libasound2-dev

did solve it.

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