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

Install canvas failed node-canvas #536

Closed
ccqpein opened this issue Mar 11, 2015 · 10 comments
Closed

Install canvas failed node-canvas #536

ccqpein opened this issue Mar 11, 2015 · 10 comments

Comments

@ccqpein
Copy link

ccqpein commented Mar 11, 2015

I install canvas for gitbook-plugin, but error again and again.

I have done this url, but its not work.
https://github.com/Automattic/node-canvas/wiki/installation---osx

Here is error log:

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:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/canvas
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "canvas" "-g"
npm ERR! node v0.12.0
npm ERR! npm v2.7.0
npm ERR! code ELIFECYCLE

npm ERR! canvas@1.2.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.2.1 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! /Users/ccQ/npm-debug.log

@matthewlynch
Copy link

I think I have the same issue as above.

I followed the instructions from the wiki and also tried the wget command in the read me. Everything seems to install okay.

Here is the output from the console:

> canvas@1.2.1 install /Users/matthewlynch/some/path
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
  SOLINK_MODULE(target) Release/canvas-postbuild.node
  SOLINK_MODULE(target) Release/canvas-postbuild.node: Finished
  CXX(target) Release/obj.target/canvas/src/Canvas.o
  CXX(target) Release/obj.target/canvas/src/CanvasGradient.o
  CXX(target) Release/obj.target/canvas/src/CanvasPattern.o
In file included from ../src/CanvasPattern.cc:10:
../src/CanvasPattern.h:23:9: warning: private field '_width' is not used [-Wunused-private-field]
    int _width, _height;
        ^
../src/CanvasPattern.h:23:17: warning: private field '_height' is not used [-Wunused-private-field]
    int _width, _height;
                ^
2 warnings generated.
  CXX(target) Release/obj.target/canvas/src/CanvasRenderingContext2d.o
../src/CanvasRenderingContext2d.cc:374:22: warning: unused variable 'surface' [-Wunused-variable]
    cairo_surface_t *surface = cairo_get_group_target(_context);
                     ^
1 warning generated.
  CXX(target) Release/obj.target/canvas/src/color.o
  CXX(target) Release/obj.target/canvas/src/Image.o
  CXX(target) Release/obj.target/canvas/src/ImageData.o
  CXX(target) Release/obj.target/canvas/src/init.o
  CXX(target) Release/obj.target/canvas/src/PixelArray.o
  CXX(target) Release/obj.target/canvas/src/FontFace.o
../src/FontFace.cc:9:10: fatal error: 'fontconfig/fontconfig.h' file not found
#include <fontconfig/fontconfig.h>
         ^
1 error generated.
make: *** [Release/obj.target/canvas/src/FontFace.o] Error 1
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:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/matthewlynch/some/path
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "canvas"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! canvas@1.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.2.1 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!     /Users/matthewlynch/some/path

Node v: 0.12.0
NPM v: 2.5.1

@ykan
Copy link

ykan commented Mar 15, 2015

same problem.

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/0.10.22/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:106:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:827:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.10.22/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ykan/Documents/gitlab/icon-magic-server/node_modules/canvas
gyp ERR! node -v v0.11.8
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok
npm ERR! canvas@1.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1

@zbjornson
Copy link
Collaborator

Not looking too closely at your errors, but I see you're all using v0.11 or 0.12. I couldn't get node-canvas to work with a version later than 0.10. (#535)

@xoorath
Copy link

xoorath commented Apr 28, 2015

node v0.12.2 worked fine for me on windows 7 32bit using the 32bit gtk package. Failed on windows 7 64bit using the 64bit gtk package.

edit: Using the 32bit gtk2 worked fine for me on Windows 7 64bit. 👍

http://www.gtk.org/download/win32.php

Would really love to see an easier and more up to date windows workflow though...

@arb
Copy link

arb commented Apr 28, 2015

Same error here on OSX using Node 0.10.38. I followed the install instructions by hand and have the same problem with the [Release/obj.target/canvas/src/FontFace.o] Error 1

@z3t0
Copy link

z3t0 commented Jun 19, 2015

I also have this problem on 64 bit windows 8 when trying to use three.js on node. Any suggestions?

@zbjornson
Copy link
Collaborator

@xoorath was that with 32-bit node? (e.g. 32-bit everything)

@xoorath
Copy link

xoorath commented Jul 26, 2015

@zbjornson 32-bit everything worked as expected. 64-bit everything didn't. The 64-bit setup was fixed by switching GTK to 32-bit, while leaving everything else 64.

@relu-xz
Copy link

relu-xz commented Aug 30, 2015

Hey guys, I've posted a solution for this.

@LinusU
Copy link
Collaborator

LinusU commented Feb 15, 2016

Please see the posted solution, or the updated wiki-page for windows.

For OS X please try the updated installation instructions.

Thanks

@LinusU LinusU closed this as completed Feb 15, 2016
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

9 participants