Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install fails on raspbian #58

Closed
maikschneider opened this issue Jun 16, 2014 · 8 comments
Closed

npm install fails on raspbian #58

maikschneider opened this issue Jun 16, 2014 · 8 comments

Comments

@maikschneider
Copy link

On my RaspberryPi the install process crashes at the cpplint command.
The installation:

npm @1.4.9
node @v0.10.28

This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.2          gcc, popt(m), exif, no cdk, no aa, jpeg, no readline
libgphoto2      2.5.2          all camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.10.0         gcc, ltdl, USB, serial without locking

The error:

pi@raspberrypi ~/photobox_node/node_modules/gphoto2 $ npm install

> gphoto2@0.1.6 preinstall /home/pi/photobox_node/node_modules/gphoto2
> ((which pkg-config && pkg-config libgphoto2) || (which dpkg && dpkg -s libgphoto2-2-dev) || (which brew && brew list libgphoto2) || (echo 'ERROR: libgphoto2 seems not to be installed.' 1>&2; exit 1)) && node-gyp rebuild

/usr/bin/pkg-config
make: Entering directory `/home/pi/photobox_node/node_modules/gphoto2/build'
  CXX(target) Release/obj.target/gphoto2/src/autodetect.o
  CXX(target) Release/obj.target/gphoto2/src/binding.o
  CXX(target) Release/obj.target/gphoto2/src/camera.o
  CXX(target) Release/obj.target/gphoto2/src/camera_helpers.o
  CXX(target) Release/obj.target/gphoto2/src/gphoto.o
  SOLINK_MODULE(target) Release/obj.target/gphoto2.node
  SOLINK_MODULE(target) Release/obj.target/gphoto2.node: Finished
  COPY Release/gphoto2.node
make: Leaving directory `/home/pi/photobox_node/node_modules/gphoto2/build'

> gphoto2@0.1.6 prepublish /home/pi/photobox_node/node_modules/gphoto2
> npm run cpplint


> gphoto2@0.1.6 cpplint /home/pi/photobox_node/node_modules/gphoto2
> util/cpplint.sh

Error: Please follow Google's style guidelines
Done processing src/binding.cc
src/camera.h:3:  #ifndef header guard has wrong style, please use: NODE_MODULES_GPHOTO2_SRC_CAMERA_H_  [build/header_guard] [5]
src/camera.h:148:  #endif line should be "#endif  // NODE_MODULES_GPHOTO2_SRC_CAMERA_H_"  [build/header_guard] [5]
Done processing src/camera.h
src/binding.h:3:  #ifndef header guard has wrong style, please use: NODE_MODULES_GPHOTO2_SRC_BINDING_H_  [build/header_guard] [5]
src/binding.h:99:  #endif line should be "#endif  // NODE_MODULES_GPHOTO2_SRC_BINDING_H_"  [build/header_guard] [5]
Done processing src/binding.h
Done processing src/camera.cc
Done processing src/camera_helpers.cc
Done processing src/gphoto.cc
Done processing src/autodetect.cc
src/gphoto.h:3:  #ifndef header guard has wrong style, please use: NODE_MODULES_GPHOTO2_SRC_GPHOTO_H_  [build/header_guard] [5]
src/gphoto.h:72:  #endif line should be "#endif  // NODE_MODULES_GPHOTO2_SRC_GPHOTO_H_"  [build/header_guard] [5]
Done processing src/gphoto.h
Total errors found: 6

npm ERR! gphoto2@0.1.6 cpplint: `util/cpplint.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gphoto2@0.1.6 cpplint script.
npm ERR! This is most likely a problem with the gphoto2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     util/cpplint.sh
npm ERR! You can get their info via:
npm ERR!     npm owner ls gphoto2
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.12.20+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "run" "cpplint"
npm ERR! cwd /home/pi/photobox_node/node_modules/gphoto2
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/photobox_node/node_modules/gphoto2/npm-debug.log
npm ERR! not ok code 0

npm ERR! gphoto2@0.1.6 prepublish: `npm run cpplint`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gphoto2@0.1.6 prepublish script.
npm ERR! This is most likely a problem with the gphoto2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run cpplint
npm ERR! You can get their info via:
npm ERR!     npm owner ls gphoto2
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.12.20+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /home/pi/photobox_node/node_modules/gphoto2
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/photobox_node/node_modules/gphoto2/npm-debug.log
npm ERR! not ok code 0

I also have a question about running the tests: Why is the coffee file not compiled? The coffee-script package is installed globally and locally..
My output:

pi@raspberrypi ~/photobox_node/node_modules/gphoto2 $ npm test

> gphoto2@0.1.6 test /home/pi/photobox_node/node_modules/gphoto2
> node_modules/mocha/bin/mocha


/home/pi/photobox_node/node_modules/gphoto2/test/camera.test.coffee:1
ion (exports, require, module, __filename, __dirname) { global[id] ?= require
                                                                    ^
SyntaxError: Unexpected token =
  at Module._compile (module.js:439:25)
  at Object.Module._extensions..js (module.js:474:10)
  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 /home/pi/photobox_node/node_modules/gphoto2/node_modules/mocha/lib/mocha.js:172:27
  at Array.forEach (native)
  at Mocha.loadFiles (/home/pi/photobox_node/node_modules/gphoto2/node_modules/mocha/lib/mocha.js:169:14)
  at Mocha.run (/home/pi/photobox_node/node_modules/gphoto2/node_modules/mocha/lib/mocha.js:356:31)
  at Object.<anonymous> (/home/pi/photobox_node/node_modules/gphoto2/node_modules/mocha/bin/_mocha:366:16)
  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)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:906:3

npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

Thanks!

@lpinca
Copy link
Contributor

lpinca commented Jun 17, 2014

@maikschneider the first error is caused by the fact that you don't have a .git folder in the package installed by npm. The C++ linter depends on that folder and when it is not found spurious errors are generated.
The above pull request should fix that issue.

You can skip the linter step by simply running npm run preinstall.

If you want to play with the tests and the sources i reccomend you to clone the git repo.

@lpinca
Copy link
Contributor

lpinca commented Jun 17, 2014

@maikschneider you should be able to run the tests again when the above patch will be merged.

@tbranyen
Copy link

FWIW I was able to install this module on a Rapsberry PI running Arch

@lwille
Copy link
Owner

lwille commented Jan 19, 2015

Should be fixed in 0.1.7 (ba9a9b9).

@lwille lwille closed this as completed Jan 19, 2015
@lukasMega
Copy link

Error:

gphoto2.target.mk:86: recipe for target 'Release/obj.target/gphoto2/src/autodetect.o' failed
make: *** [Release/obj.target/gphoto2/src/autodetect.o] Error 1
make: Leaving directory '/tmp/node-gphoto/node_modules/gphoto2/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/iojs/current/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:169:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1044:12)
gyp ERR! System Linux 3.18.10-v7+
gyp ERR! command "/home/iojs/current/bin/iojs" "/home/iojs/current/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/node-gphoto/node_modules/gphoto2
gyp ERR! node -v v1.6.2
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 3.18.10-v7+
npm ERR! argv "/home/iojs/current/bin/iojs" "/home/iojs/current/bin/npm" "install" "--save" "gphoto2"
npm ERR! node v1.6.2
npm ERR! npm  v2.7.1
npm ERR! code ELIFECYCLE

npm ERR! gphoto2@0.1.7 preinstall: `((which pkg-config && pkg-config libgphoto2) || (which dpkg && dpkg -s libgphoto2-2-dev) || (which brew && brew list libgphoto2) || (echo 'ERROR: libgphoto2 seems not to be installed.' 1>&2; exit 1)) && node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gphoto2@0.1.7 preinstall script '((which pkg-config && pkg-config libgphoto2) || (which dpkg && dpkg -s libgphoto2-2-dev) || (which brew && brew list libgphoto2) || (echo 'ERROR: libgphoto2 seems not to be installed.' 1>&2; exit 1)) && node-gyp rebuild'.
npm ERR! This is most likely a problem with the gphoto2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ((which pkg-config && pkg-config libgphoto2) || (which dpkg && dpkg -s libgphoto2-2-dev) || (which brew && brew list libgphoto2) || (echo 'ERROR: libgphoto2 seems not to be installed.' 1>&2; exit 1)) && node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls gphoto2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /tmp/node-gphoto/npm-debug.log

Complete error message is quite long. See: http://pastebin.com/raw.php?i=xzmknwn0

 
 

My environment (Raspberry Pi 2):

root@raspberrypi:/tmp/node-gphoto# uname -a
Linux raspberrypi 3.18.10-v7+ #774 SMP PREEMPT Wed Mar 25 14:10:30 GMT 2015 armv7l GNU/Linux


root@raspberrypi:/tmp/node-gphoto# python --version
Python 2.7.9

root@raspberrypi:/tmp/node-gphoto# node -v
v1.6.2

root@raspberrypi:/tmp/node-gphoto# iojs -v
v1.6.2

root@raspberrypi:/tmp/node-gphoto# npm -v
2.7.1



root@raspberrypi:/tmp/node-gphoto# cat /proc/version
Linux version 3.18.10-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #774 SMP PREEMPT Wed Mar 25 14:10:30 GMT 2015
root@raspberrypi:/tmp/node-gphoto#


root@raspberrypi:/tmp/node-gphoto# gphoto2 -v
gphoto2 2.5.6

Copyright (c) 2000-2014 Lutz Mueller and others

gphoto2 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of gphoto2 under the terms of the GNU General Public
License. For more information about these matters, see the files named COPYING.

This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.6          gcc, popt(m), exif, no cdk, no aa, no jpeg, no readline
libgphoto2      2.5.4          all camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.12.0         gcc, ltdl, USB, serial without locking




root@raspberrypi:/tmp/node-gphoto# dpkg -s libgphoto2-2-dev
Package: libgphoto2-2-dev
Status: install ok installed
Priority: extra
Section: oldlibs
Installed-Size: 86
Maintainer: Debian PhotoTools Maintainers <pkg-phototools-devel@lists.alioth.debian.org>
Architecture: armhf
Source: libgphoto2
Version: 2.5.4-1.1
Depends: libgphoto2-dev (= 2.5.4-1.1)
Description: gphoto2 digital camera library (transitional package)
 The gphoto2 library can be used by applications to access various
 digital camera models, via standard protocols such as USB Mass Storage
 and PTP, or vendor-specific protocols.
 .
 This package is a transitional package and can be safely be removed.



root@raspberrypi:/tmp/node-gphoto# pkg-config libgphoto2; echo $?
0


root@raspberrypi:/tmp/node-gphoto# which brew; echo $?
1

@lpinca
Copy link
Contributor

lpinca commented Mar 27, 2015

@lukasMega the module does not work with node 0.12 / io.js.
@lwille is working to fix this, see #67.

@lukasMega
Copy link

thanks for quick reply. Do you plan to support io.js? or node.js >= 0.12 ?

@lpinca
Copy link
Contributor

lpinca commented Mar 27, 2015

I don't know but I think that the current plan is to use https://github.com/rvagg/nan so It should compile fine with older, current, and future versions of node / io.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants