meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation
http://camanjs.com
BSD 3-Clause "New" or "Revised" License
3.55k stars 404 forks source link

Cannot install CamanJS/Caman.JS in Nodejs/Node.js #102

Closed myjangle closed 11 years ago

myjangle commented 11 years ago

Hello guys, i have been trying to install Camanjs using nodejs but it get these errors, i do not know what it really means, i am using the ubuntu 11.04 operating system and did used the command 'npm install caman' while logged as admin here is the output

npm http GET https://registry.npmjs.org/caman npm http 304 https://registry.npmjs.org/caman npm http GET https://registry.npmjs.org/fibers npm http GET https://registry.npmjs.org/canvas npm http 304 https://registry.npmjs.org/canvas npm http 304 https://registry.npmjs.org/fibers

canvas@1.1.0 install /home/muneeb/node_modules/caman/node_modules/canvas node-gyp rebuild

fibers@1.0.1 install /home/muneeb/node_modules/caman/node_modules/fibers node ./build.js

linux-ia32-v8-3.14 exists; testing Binary is fine; exiting make: Entering directory > /home/muneeb/node_modules/caman/node_modules/canvas/build' CXX(target) Release/obj.target/canvas/src/Canvas.o In file included from ../src/Canvas.cc:8:0: ../src/PNG.h: In function ‘cairo_status_t canvas_write_png(cairo_surface_t*, void > (*)(png_struct*, png_byte*, png_size_t), void*)’: ../src/PNG.h:139:10: error: ‘CAIRO_FORMAT_RGB30’ was not declared in this > > scope make: *** [Release/obj.target/canvas/src/Canvas.o] Error 1 make: Leaving directory >/home/muneeb/node_modules/caman/node_modules/canvas/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit > (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit > (child_process.js:789:12) gyp ERR! System Linux 2.6.35-32-generic-pae gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/muneeb/node_modules/caman/node_modules/canvas gyp ERR! node -v v0.10.8 gyp ERR! node-gyp -v v0.9.5 gyp ERR! not ok npm ERR! weird error 1 npm ERR! not ok code 0 screenshot

Below is a screenshot of it. Thanks, any help would be appreciated.

meltingice commented 11 years ago

This is a node-canvas issue. It looks like some other users are having the same problem in LearnBoost/node-canvas#315.

myjangle commented 11 years ago

thanks!

Renatico commented 11 years ago

Hello, guys. I have the same issue and would want to get an answer how to fix it. I read this conversation and that (LearnBoost/node-canvas#315). But I didn't understand what I have to do? Please, write more explicit instruction. Thanks in advance...

myjangle commented 11 years ago

You can fix the problem by using the npm command in the terminal to install canvas version 1.0.4 first make sure that you have removed other versions of cavas by using the npm ls command to see if any other version is installed once that it done you can use npm install canvas@1.0.4 to install canvas version 1.0.4 then try installing caman again

Renatico commented 11 years ago

Thank you, Myjangle. I wanted to write about my positive experience with "sudo npm install canvas@1.0.4" but you were faster. Thank you. But now I tried the following code from the "basic usage":

var Caman = require('caman').Caman; Caman("images/test2_650_530.jpg", function () { this.brightness(5); this.render(function () { this.save("images/test2_650_530_2.jpg"); }); });

Of course, I use my own server side directory and source file. But I have got an error message:

Error: Image given has not completed loading at Caman.finishInit (/var/www/effects/node_modules/caman/dist/caman.full.js:463:22) at Caman.nodeFileReady (/var/www/effects/node_modules/caman/dist/caman.full.js:372:19) at /var/www/effects/node_modules/caman/dist/caman.full.js:7:61 at fs.js:266:14 at Object.oncomplete (fs.js:107:15)

The lines' numbers might differ from yours but the verbal parts of the error speaks for itself quite explicitly. Have you met it early? What was your solution? Thank you in advance.