guo-yu / player

a command line player, supports play mp3 both from uri and local stream.
261 stars 66 forks source link

Can't install #35

Closed canda closed 9 years ago

canda commented 9 years ago

I think is something related with speaker dependency I'm trying to install with:

npm install player

But I get:

> speaker@0.2.1 install /home/canda/node_modules/player/node_modules/speaker
> node-gyp rebuild

make: Entering directory `/home/canda/node_modules/player/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 file or directory
 #include <alsa/asoundlib.h>
                            ^
compilation terminated.
make: *** [Release/obj.target/output/deps/mpg123/src/output/alsa.o] Error 1
make: Leaving directory `/home/canda/node_modules/player/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:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.13.0-46-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/canda/node_modules/player/node_modules/speaker
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 
guo-yu commented 9 years ago

Did you try node-speaker v0.2.3? I installed v0.2.4 and it was ok.

> speaker@0.2.4 install /Users/Turing/GitHub/public/player/node_modules/speaker
> node-gyp rebuild

  CC(target) Release/obj.target/output/deps/mpg123/src/output/coreaudio.o
  LIBTOOL-STATIC Release/liboutput.a
  CXX(target) Release/obj.target/binding/src/binding.o
  SOLINK_MODULE(target) Release/binding.node
  SOLINK_MODULE(target) Release/binding.node: Finished

......

speaker@0.2.4 node_modules/speaker
├── bindings@1.2.1
├── nan@1.6.2
└── readable-stream@1.0.33 (isarray@0.0.1, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.1)
guo-yu commented 9 years ago

Your error log showed that libasound2-dev was required.

On Debian/Ubuntu, the ALSA backend is selected by default, so be sure to have the alsa.h header file in place:

sudo apt-get install libasound2-dev
flexzuu commented 9 years ago

Hey can you help me pls got some weird errors i dont understand. I have gone through https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/

Got it to work on my mac. Windows now luck so far. BTW why can i play songs in a sub dir? In root folder it is working just fine.

$ npm install player -g

> speaker@0.2.1 install G:\Jonas\AppData\Roaming\npm\node_modules\player\node_modules\speaker
> node-gyp rebuild

G:\Jonas\AppData\Roaming\npm\node_modules\player\node_modules\speaker>if not defined npm_config_node_gyp (node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (rebuild)
gyp ERR! configure error
gyp ERR! stack Error: spawn C:\Python27 ENOENT
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
gyp ERR! stack     at child_process.js:1144:20
gyp ERR! stack     at process._tickCallback (node.js:355:11)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd G:\Jonas\AppData\Roaming\npm\node_modules\player\node_modules\speaker
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok

> lame@1.1.1 install G:\Jonas\AppData\Roaming\npm\node_modules\player\node_modules\lame
> node-gyp rebuild

G:\Jonas\AppData\Roaming\npm\node_modules\player\node_modules\lame>if not defined npm_config_node_gyp (node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (rebuild)
gyp ERR! configure error
gyp ERR! stack Error: spawn C:\Python27 ENOENT
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
gyp ERR! stack     at child_process.js:1144:20
gyp ERR! stack     at process._tickCallback (node.js:355:11)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd G:\Jonas\AppData\Roaming\npm\node_modules\player\node_modules\lame
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "player" "-g"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

npm ERR! speaker@0.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the speaker@0.2.1 install script 'node-gyp rebuild'.
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! Please include the following file with any support request:
npm ERR!     g:\Jonas\documents\node\nodealarmclock\npm-debug.log

If i try to intall newest speaker build

$ npm install speaker -g
-
> speaker@0.2.5 install G:\Jonas\AppData\Roaming\npm\node_modules\speaker
> node-gyp rebuild

G:\Jonas\AppData\Roaming\npm\node_modules\speaker>if not defined npm_config_node_gyp (node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (rebuild)
gyp ERR! configure error
gyp ERR! stack Error: spawn C:\Python27 ENOENT
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
gyp ERR! stack     at child_process.js:1144:20
gyp ERR! stack     at process._tickCallback (node.js:355:11)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd G:\Jonas\AppData\Roaming\npm\node_modules\speaker
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "speaker" "-g"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

npm ERR! speaker@0.2.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the speaker@0.2.5 install script 'node-gyp rebuild'.
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! Please include the following file with any support request:
npm ERR!     g:\Jonas\documents\node\nodealarmclock\npm-debug.log
guo-yu commented 9 years ago

player module do not works well in Windows right now. could you please check the latest version v0.4.1 and try again?