neocotic / qrious

Pure JavaScript library for QR code generation using canvas
https://neocotic.com/qrious
Other
1.55k stars 215 forks source link

Can't install properly, dependency is triggering error #37

Closed diosney closed 9 years ago

diosney commented 9 years ago

The full stack error npm gives is below:

user@machine:~/Projects/some-project$ npm install qr-js --save
-
> canvas@1.1.6 install /home/user/Projects/some-project/node_modules/qr-js/node_modules/canvas
> node-gyp rebuild

Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.13.0-62-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/Projects/some-project/node_modules/qr-js/node_modules/canvas
gyp ERR! node -v v0.10.37
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 

npm ERR! canvas@1.1.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.1.6 install script.
npm ERR! This is most likely a problem with the canvas 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 canvas
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-62-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "qr-js" "--save"
npm ERR! cwd /home/user/Projects/some-project
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

Thanks

diosney commented 9 years ago

Nevermind, found the canvas install instructions at https://github.com/Automattic/node-canvas/wiki/Installation---Ubuntu-and-other-Debian-based-systems

If this is a requirement for this module to work, It would be nice that this information is stated in the README at the install section, since one normally assumes that npm install (per readme) is the only thing only one needs to do.

BTW Have you considered removing all this specific OS dependencies?

Thanks

neocotic commented 9 years ago

Beat me to it :smile:

neocotic commented 9 years ago

I am considering investing some more time into this project again as I have a few ideas for it which will include attempting to remove node binding, improve image scaling, and making the code more modular and easier to manage and maintain. I will probably attempt to leverage browserify for some of these.

diosney commented 9 years ago

Good to know! This is the qr generation module at npm that I wanted to install due its feature set (fg and bg colors, scaling, etc) but I reconsidered after the dependency issue, since I need that the install flows smoothly and have to do it on several machines with different OSes.

uikro commented 9 years ago

C:\MyApp>npm install qr-js npm WARN package.json MyApp@1.0.0 No repository field.

npm WARN package.json MyApp@1.0.0 No README data

canvas@1.1.6 install C:\MyApp\node_modules\qr-js\node_modules\canvas node-gyp rebuild

C:\MyApp\node_modules\qr-js\node_modules\canvas>node "C:\Program Files\nodejs\n ode_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" r ebuild gyp ERR! configure error gyp ERR! stack Error: spawn /usr/bin/python2 ENOENT gyp ERR! stack at exports._errnoException (util.js:746:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1046 :32) gyp ERR! stack at child_process.js:1137:20 gyp ERR! stack at process._tickCallback (node.js:355:11) gyp ERR! System Windows_NT 6.3.9600 gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu les\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\MyApp\node_modules\qr-js\node_modules\canvas gyp ERR! node -v v0.12.0 gyp ERR! node-gyp -v v1.0.2 gyp ERR! not ok npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs \node_modules\npm\bin\npm-cli.js" "install" "qr-js" npm ERR! node v0.12.0 npm ERR! npm v2.5.1 npm ERR! code ELIFECYCLE

npm ERR! canvas@1.1.6 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the canvas@1.1.6 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the canvas 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 canvas npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\MyApp\npm-debug.log

neocotic commented 9 years ago

@uikro Please see the following instructions on installing node-canvas on Windows:

https://github.com/Automattic/node-canvas/wiki/Installation---Windows