Ich habe ein Raspberry Pi Model B + und arbeite derzeit mit Webentwicklung. Heute habe ich den Quellcode von Node.js erfolgreich auf meinem Raspberry Pi kompiliert und konnte ihn problemlos installieren. Meine aktuelle Node.js-Version ist Version 0.8.16, die mit dem NPM-Modulmanager (1.1.69) geliefert wird. Wenn ich versuche, das Lautsprechermodul (Node-Speaker) zu installieren, werden einige Fehler angezeigt. Ich brauche wirklich Hilfe bei der Installation dieses speziellen Moduls.
Dies ist der Fehler, den NPM auf mich wirft:
root@raspberrypi:/# npm install speaker
npm http GET https://registry.npmjs.org/speaker
npm http 304 https://registry.npmjs.org/speaker
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/readable-stream
npm http 304 https://registry.npmjs.org/readable-stream
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/ms/0.6.2
npm http GET https://registry.npmjs.org/core-util-is
npm http GET https://registry.npmjs.org/isarray/0.0.1
npm http GET https://registry.npmjs.org/string_decoder
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/core-util-is
npm http 304 https://registry.npmjs.org/isarray/0.0.1
npm http 304 https://registry.npmjs.org/ms/0.6.2
npm http 304 https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/inherits
> speaker@0.2.2 install /node_modules/speaker
> node-gyp rebuild
gyp WARN EACCES user "root" does not have permission to access the dev dir "/roo t/.node-gyp/0.8.16"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/node_modules/s peaker/.node-gyp"
gyp http GET http://nodejs.org/dist/v0.8.16/node-v0.8.16.tar.gz
gyp http 200 http://nodejs.org/dist/v0.8.16/node-v0.8.16.tar.gz
make: Entering directory '/node_modules/speaker/build'
CC(target) Release/obj.target/output/deps/mpg123/src/output/alsa.o
../deps/mpg123/src/output/alsa.c:19:28: fatal error: alsa/asoundlib.h: No such f ile or directory
compilation terminated.
deps/mpg123/output.target.mk:92: recipe for target 'Release/obj.target/output/de ps/mpg123/src/output/alsa.o' failed
make: *** [Release/obj.target/output/deps/mpg123/src/output/alsa.o] Error 1
make: Leaving directory '/node_modules/speaker/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_ modules/node-gyp/lib/build.js:232:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Linux 3.12.35+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/b in/node-gyp.js" "rebuild"
gyp ERR! cwd /node_modules/speaker
gyp ERR! node -v v0.8.16
gyp ERR! node-gyp -v v0.7.3
gyp ERR! not ok
npm ERR! speaker@0.2.2 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the speaker@0.2.2 install script.
npm ERR! This is most likely a problem with the speaker package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls speaker
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.12.35+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "speaker"
npm ERR! cwd /
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /npm-debug.log
npm ERR! not ok code 0
Es scheint, dass das Problem beginnt, wenn NPM versucht, diesen Befehl auszuführen:
node-gyp rebuild
Wie kann ich dieses Problem beheben?