npm run build fails #201

Closed
Germanunkol opened this Issue Apr 16, 2014 · 18 comments

Comments

Projects
None yet
4 participants
pi@raspberrypi ~/Music/groovebasin $ npm run build

> groovebasin@1.0.1 build /home/pi/Music/groovebasin
> npm install && ./build

npm http GET https://registry.npmjs.org/lastfm
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/superagent
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/mv
npm http GET https://registry.npmjs.org/pend
npm http GET https://registry.npmjs.org/zfill/0.0.1
npm http GET https://registry.npmjs.org/requireindex
npm http GET https://registry.npmjs.org/mess
npm http GET https://registry.npmjs.org/groove
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/level
npm http GET https://registry.npmjs.org/findit
npm http GET https://registry.npmjs.org/archiver
npm http GET https://registry.npmjs.org/uuid
npm http GET https://registry.npmjs.org/music-library-index
npm http GET https://registry.npmjs.org/keese
npm http GET https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/jsondiffpatch
npm http GET https://registry.npmjs.org/connect-static
npm http GET https://registry.npmjs.org/multiparty
npm http GET https://registry.npmjs.org/ytdl
npm http GET https://registry.npmjs.org/serve-static
npm http GET https://registry.npmjs.org/body-parser
npm http GET https://registry.npmjs.org/stylus
npm http GET https://registry.npmjs.org/browserify

npm ERR! Error: failed to fetch from registry: mkdirp
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR!     at ClientRequest.g (events.js:156:14)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/pi/Music/groovebasin/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.6.11+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/Music/groovebasin
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: mkdirp
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/Music/groovebasin/npm-debug.log
npm not ok

npm ERR! groovebasin@1.0.1 build: `npm install && ./build`
npm ERR! `sh "-c" "npm install && ./build"` failed with 1
npm ERR! 
npm ERR! Failed at the groovebasin@1.0.1 build script.
npm ERR! This is most likely a problem with the groovebasin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm install && ./build
npm ERR! You can get their info via:
npm ERR!     npm owner ls groovebasin
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Linux 3.6.11+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! cwd /home/pi/Music/groovebasin
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! code ELIFECYCLE
npm ERR! message groovebasin@1.0.1 build: `npm install && ./build`
npm ERR! message `sh "-c" "npm install && ./build"` failed with 1
npm ERR! errno {}
npm WARN This failure might be due to the use of legacy binary "node" 
npm WARN For further explanations, please read
npm WARN /usr/share/doc/nodejs/README.Debian
npm WARN 
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/Music/groovebasin/npm-debug.log
npm not ok

Sadly I have never used npm, so I don't know if this is project-related. I've updated npm using:

npm update npm -g

Output of npm -v:
1.1.4

Since I'm running on a raspberry pi, this version might be old. However, you mention groovebasin could be run on a pi, so I'm wondering: Do I need to manually install npm (newest version), too?

Owner

andrewrk commented Apr 16, 2014

Hmm, looks like you're on a pretty old npm version. For example mine is 1.4.3. Unfortunately the version of node that is in Debian/Raspbian is not suitable. I had to compile node.js 10.x from source to get it to work. Node.js comes with npm by the way, so that will give you the correct version.

Sorry that this process is so complicated to set up - a couple versions into the future I plan to provide a .deb package to install groovebasin directly.

I upgraded manually to npm 1.4.3 as well and npm run build seemed to work just fine. Now, however, npm start fails (with and without sudo):

pi@raspberrypi ~/Music/groovebasin $ sudo npm start

> groovebasin@1.0.1 start /home/pi/Music/groovebasin
> node lib/server.js


/home/pi/Music/groovebasin/node_modules/groove/node_modules/bindings/bindings.js:83
        throw e
              ^
Error: libgroove.so.3: cannot open shared object file: No such file or directory
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at bindings (/home/pi/Music/groovebasin/node_modules/groove/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/home/pi/Music/groovebasin/node_modules/groove/lib/index.js:1:97)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

npm ERR! groovebasin@1.0.1 start: `node lib/server.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the groovebasin@1.0.1 start script.
npm ERR! This is most likely a problem with the groovebasin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node lib/server.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls groovebasin
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.6.11+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! cwd /home/pi/Music/groovebasin
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/Music/groovebasin/npm-debug.log
npm ERR! not ok code 0

I do not know if this is related to the above, so I didn't want to open a new issue.

Thanks for all the help so far, I appreciate it. Hope I can get this all to work, I'd love to be able to control the music station through the web interface.

Additional info:
Since it seems to be looking for libgroove, I tried to re-install libgroove by running sudo make install again in the libgroove build directory. Here's what I get (from what I gather it's all installed correctly, but it's weird that it's placed in arm-linux-gnueabihf instead of just /usr/local/lib, like all the other libraries (libavutil, for example)):

[  5%] Built target groove
[ 10%] Built target groove_static
[ 11%] Built target ebur128_static
[ 12%] Built target grooveloudness
[ 12%] Built target grooveloudness_static
[ 92%] Built target SDL2-static
[ 93%] Built target grooveplayer
[ 94%] Built target grooveplayer_static
[ 95%] Built target metadata
[ 96%] Built target playlist
[ 97%] Built target replaygain
[ 98%] Built target transcode
[ 99%] Built target ebur128
[100%] Built target SDL2main
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgroove.a
-- Up-to-date: /usr/local/include/groove/groove.h
-- Up-to-date: /usr/local/include/groove/queue.h
-- Up-to-date: /usr/local/include/groove/encoder.h
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgroove.so.3.0.8
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgroove.so.3
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgroove.so
-- Up-to-date: /usr/local/include/grooveplayer/player.h
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgrooveplayer.so.3.0.8
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgrooveplayer.so.3
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgrooveplayer.so
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgrooveplayer.a
-- Up-to-date: /usr/local/include/grooveloudness/loudness.h
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgrooveloudness.so.3.0.8
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgrooveloudness.so.3
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgrooveloudness.so
-- Up-to-date: /usr/local/lib/arm-linux-gnueabihf/libgrooveloudness.a
-- Up-to-date: /usr/local/lib/libSDL2.a
-- Up-to-date: /usr/local/lib/libSDL2main.a
-- Up-to-date: /usr/local/include/SDL2/SDL_rwops.h
-- Up-to-date: /usr/local/include/SDL2/SDL_touch.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_assert.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_log.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_font.h
-- Up-to-date: /usr/local/include/SDL2/SDL_config_psp.h
-- Up-to-date: /usr/local/include/SDL2/SDL_version.h
-- Up-to-date: /usr/local/include/SDL2/SDL_loadso.h
-- Up-to-date: /usr/local/include/SDL2/SDL_log.h
-- Up-to-date: /usr/local/include/SDL2/SDL_platform.h
-- Up-to-date: /usr/local/include/SDL2/SDL_config_android.h
-- Up-to-date: /usr/local/include/SDL2/SDL_filesystem.h
-- Up-to-date: /usr/local/include/SDL2/SDL_shape.h
-- Up-to-date: /usr/local/include/SDL2/SDL_audio.h
-- Up-to-date: /usr/local/include/SDL2/SDL_config_iphoneos.h
-- Up-to-date: /usr/local/include/SDL2/SDL_opengles2.h
-- Up-to-date: /usr/local/include/SDL2/SDL_mouse.h
-- Up-to-date: /usr/local/include/SDL2/SDL_syswm.h
-- Up-to-date: /usr/local/include/SDL2/SDL_opengl.h
-- Up-to-date: /usr/local/include/SDL2/SDL_haptic.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_md5.h
-- Up-to-date: /usr/local/include/SDL2/SDL_gamecontroller.h
-- Up-to-date: /usr/local/include/SDL2/SDL_rect.h
-- Up-to-date: /usr/local/include/SDL2/SDL_thread.h
-- Up-to-date: /usr/local/include/SDL2/SDL_types.h
-- Up-to-date: /usr/local/include/SDL2/SDL_config_windows.h
-- Up-to-date: /usr/local/include/SDL2/SDL_mutex.h
-- Up-to-date: /usr/local/include/SDL2/SDL_keycode.h
-- Up-to-date: /usr/local/include/SDL2/SDL_hints.h
-- Up-to-date: /usr/local/include/SDL2/SDL_messagebox.h
-- Up-to-date: /usr/local/include/SDL2/SDL_keyboard.h
-- Up-to-date: /usr/local/include/SDL2/SDL_timer.h
-- Up-to-date: /usr/local/include/SDL2/SDL_video.h
-- Up-to-date: /usr/local/include/SDL2/SDL_clipboard.h
-- Up-to-date: /usr/local/include/SDL2/SDL_atomic.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_harness.h
-- Up-to-date: /usr/local/include/SDL2/SDL_main.h
-- Up-to-date: /usr/local/include/SDL2/SDL.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_fuzzer.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_common.h
-- Up-to-date: /usr/local/include/SDL2/SDL_blendmode.h
-- Up-to-date: /usr/local/include/SDL2/SDL_endian.h
-- Up-to-date: /usr/local/include/SDL2/SDL_scancode.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_compare.h
-- Up-to-date: /usr/local/include/SDL2/SDL_joystick.h
-- Up-to-date: /usr/local/include/SDL2/SDL_quit.h
-- Up-to-date: /usr/local/include/SDL2/SDL_config_wiz.h
-- Up-to-date: /usr/local/include/SDL2/SDL_copying.h
-- Up-to-date: /usr/local/include/SDL2/SDL_config_minimal.h
-- Up-to-date: /usr/local/include/SDL2/SDL_events.h
-- Up-to-date: /usr/local/include/SDL2/SDL_opengles.h
-- Up-to-date: /usr/local/include/SDL2/SDL_name.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test.h
-- Up-to-date: /usr/local/include/SDL2/SDL_system.h
-- Up-to-date: /usr/local/include/SDL2/SDL_revision.h
-- Up-to-date: /usr/local/include/SDL2/close_code.h
-- Up-to-date: /usr/local/include/SDL2/SDL_stdinc.h
-- Up-to-date: /usr/local/include/SDL2/SDL_pixels.h
-- Up-to-date: /usr/local/include/SDL2/begin_code.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_random.h
-- Up-to-date: /usr/local/include/SDL2/SDL_bits.h
-- Up-to-date: /usr/local/include/SDL2/SDL_assert.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_crc32.h
-- Up-to-date: /usr/local/include/SDL2/SDL_render.h
-- Up-to-date: /usr/local/include/SDL2/SDL_surface.h
-- Up-to-date: /usr/local/include/SDL2/SDL_config_macosx.h
-- Up-to-date: /usr/local/include/SDL2/SDL_gesture.h
-- Up-to-date: /usr/local/include/SDL2/SDL_config_pandora.h
-- Up-to-date: /usr/local/include/SDL2/SDL_power.h
-- Up-to-date: /usr/local/include/SDL2/SDL_test_images.h
-- Up-to-date: /usr/local/include/SDL2/SDL_cpuinfo.h
-- Up-to-date: /usr/local/include/SDL2/SDL_error.h
-- Up-to-date: /usr/local/include/SDL2/SDL_config.h
-- Up-to-date: /usr/local/lib/pkgconfig/sdl2.pc
-- Up-to-date: /usr/local/bin/sdl2-config
-- Up-to-date: /usr/local/share/aclocal/sdl2.m4
Owner

andrewrk commented Apr 17, 2014

I think you found the problem exactly. Here's the guilty commit: andrewrk/libgroove@3bb2a63

I think this is a Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739876

Meanwhile I will revert this commit since it is causing this problem.

Owner

andrewrk commented Apr 17, 2014

I reverted the commit in libgroove so that installing will go to /usr/local/lib/* like you said. However if you want to just make it work right now without waiting for a recompile you can do something like this:

sudo mv /usr/local/lib/arm-linux-gnueabihf/* /usr/local/lib/
sudo ldconfig

That at least gets the thing started, though now I'm having mpd problems, possibly unrelated. I'll keep trying and then let you know.

Owner

andrewrk commented Apr 17, 2014

groove basin no longer depends on MPD. In fact it functions as an MPD server since it supports (most of) the MPD protocol. Can you elaborate on what problems you're having?

Well, I am all of a sudden no longer getting audio to work with mpd nor with groovebasin. I am guessing it has to do with some packet I tried to install/update during the process of installation of libgroove/groovebasin. With mpd/ncmpcpp I get "n/a" as volume and "problem setting volume" when I try to increase/decrease it.
When starting groovebasin, I get

$ npm start

> groovebasin@1.0.1 start /home/pi/Music/groovebasin
> node lib/server.js

unable to open audio device: No such audio device
unable to initialize player: Error: player attach failed
Owner

andrewrk commented Apr 17, 2014

You might try joining #libgroove IRC channel on Freenode. I think Th0mas might have run into that same issue on his rpi and might remember what he did to fix it.

andrewrk closed this Apr 21, 2014

Just as an FYI: there is an armhf (raspi) optimized build of the latest node.js available. And it's dead easy to install:

$ wget http://node-arm.herokuapp.com/node_latest_armhf.deb
$ sudo dpkg -i node_latest_armhf.deb

M4TH76 commented May 7, 2014

Same issue here!

$ npm start

> groovebasin@1.0.1 start /home/pi/Music/groovebasin
> node lib/server.js

unable to open audio device: No such audio device
unable to initialize player: Error: player attach failed

Care to share your solution here to help other ;)

SOLVED!

make sure before compiling libgroove you have "libasound2-dev" installed

Owner

andrewrk commented May 7, 2014

on the raspberry pi, make sure you have the correct audio library installed before configuring SDL. The SDL configure output should tell you that it will have audio support.

M4TH76 commented May 7, 2014

Sorry I'm new to the linux world...
Alsa drivers were installed before compiling libgroove
mplayer work (output audio)

M4TH76 commented May 7, 2014

Has I understand it, SDL is like DirectX for linux, how can I check wich audio driver it use?
Here to output of sdl-config

 sdl-config --cflags --libs --static-libs
-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
-L/usr/lib/arm-linux-gnueabihf -lSDL
-L/usr/lib/arm-linux-gnueabihf -lSDL -lpthread -lm -ldl -lasound -lm -ldl -lpthread -lpulse-simple -lpulse -lX11 -lXext -L/usr/lib/arm-linux-gnueabihf -ldirectfb -lfusion -ldirect -lpthread -L/usr/lib/arm-linux-gnueabihf -lcaca -lts -lpthread

Thank you for your help :)

Owner

andrewrk commented May 7, 2014

I can help better if you post the cmake output for when you configured libgroove. What I will be looking for is whether you used SDL as a bundled dependency or system dependency.

M4TH76 commented May 7, 2014

Here it is:

System Dependencies
-------------------
* C99 Compiler                 : OK
* threads                      : OK
* SDL2                         : OK
* ebur128                      : not found - will use bundled version
* chromaprint                  : OK
* libavformat                  : not found - will use bundled version
* libavcodec                   : not found - will use bundled version
* libavfilter                  : not found - will use bundled version
* libavutil                    : not found - will use bundled version
* yasm                         : OK
* bzip2                        : OK
* mp3lame                      : OK
* zlib                         : OK
Owner

andrewrk commented May 7, 2014

ok so SDL is already on your system, what we need to look at now is the ./configure output for SDL, and make sure it says that it will have audio.

M4TH76 commented May 7, 2014

Ok so that means I'll have to download the source of SDL2 from git to get that info, am I right?
(./configure is like cmake)?
Sorry for the newbi questions :\

Owner

andrewrk commented May 7, 2014

Do you want to hop onto the #libgroove IRC channel on Freenode? I can give you some more real time help there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment