Skip to content

Error install canvas on Windows #414

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

Closed
285858315 opened this issue May 13, 2014 · 9 comments
Closed

Error install canvas on Windows #414

285858315 opened this issue May 13, 2014 · 9 comments

Comments

@285858315
Copy link

D:\Git\node-test>npm install
npm http GET https://registry.npmjs.org/canvas
npm http 200 https://registry.npmjs.org/canvas
npm http GET https://registry.npmjs.org/nan
npm http 200 https://registry.npmjs.org/nan

[email protected] install D:\Git\node-test\node_modules\canvas
node-gyp rebuild

D:\Git\node-test\node_modules\canvas>node "D:\nodejs\node_modules\npm\bin\node-g
yp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
CanvasRenderingContext2d.cc
CanvasPattern.cc
color.cc
PixelArray.cc
..\src\color.cc(353): warning C4305: "???": ?"double"?"float"?? [D:\Git\node-te
st\node_modules\canvas\build\canvas.vcxproj]
..\src\color.cc(356): warning C4305: "*=": ?"double"?"float"?? [D:\Git\node-tes
t\node_modules\canvas\build\canvas.vcxproj]
ImageData.cc
d:\git\node-test\node_modules\canvas\src\Canvas.h(19): fatal error C1083: ?????
???:"cairo/cairo.h": No such file or directory (..\src\CanvasRenderingContext2d
.cc) [D:\Git\node-test\node_modules\canvas\build\canvas.vcxproj]
d:\git\node-test\node_modules\canvas\src\Canvas.h(19): fatal error C1083: ?????
???:"cairo/cairo.h": No such file or directory (..\src\ImageData.cc) [D:\Git\no
de-test\node_modules\canvas\build\canvas.vcxproj]
d:\git\node-test\node_modules\canvas\src\Canvas.h(19): fatal error C1083: ?????
???:"cairo/cairo.h": No such file or directory (..\src\PixelArray.cc) [D:\Git\n
ode-test\node_modules\canvas\build\canvas.vcxproj]
d:\git\node-test\node_modules\canvas\src\Canvas.h(19): fatal error C1083: ?????
???:"cairo/cairo.h": No such file or directory (..\src\CanvasPattern.cc) [D:\Gi
t\node-test\node_modules\canvas\build\canvas.vcxproj]
Canvas.cc
init.cc
Image.cc
CanvasGradient.cc
d:\git\node-test\node_modules\canvas\src\Canvas.h(19): fatal error C1083: ?????
???:"cairo/cairo.h": No such file or directory (..\src\init.cc) [D:\Git\node-te
st\node_modules\canvas\build\canvas.vcxproj]
d:\git\node-test\node_modules\canvas\src\Canvas.h(19): fatal error C1083: ?????
???:"cairo/cairo.h": No such file or directory (..\src\Canvas.cc) [D:\Git\node-
test\node_modules\canvas\build\canvas.vcxproj]
d:\git\node-test\node_modules\canvas\src\Canvas.h(19): fatal error C1083: ?????
???:"cairo/cairo.h": No such file or directory (..\src\Image.cc) [D:\Git\node-t
est\node_modules\canvas\build\canvas.vcxproj]
d:\git\node-test\node_modules\canvas\src\Canvas.h(19): fatal error C1083: ?????
???:"cairo/cairo.h": No such file or directory (..\src\CanvasGradient.cc) [D:\G
it\node-test\node_modules\canvas\build\canvas.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\nodejs\node_modules\npm\node_modul
es\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:797:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\nodejs\node_modules\npm\node_modules\node-gyp
bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Git\node-test\node_modules\canvas
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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 Windows_NT 6.1.7601
npm ERR! command "D:\nodejs\node.exe" "D:\nodejs\node_modules\npm\bin\n
pm-cli.js" "install"
npm ERR! cwd D:\Git\node-test
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\Git\node-test\npm-debug.log
npm ERR! not ok code 0

@rvagg
Copy link
Contributor

rvagg commented May 13, 2014

have you followed https://github.com./LearnBoost/node-canvas/wiki/Installation---Windows ?
it's very picky about where things go and exactly what versions you use on Windows.

@petarov
Copy link

petarov commented May 14, 2014

d:\git\node-test\node_modules\canvas\src\Canvas.h(19): fatal error C1083: ????? ???:"cairo/cairo.h": No such file or directory (..\src\CanvasRenderingContext2d

Do you have GTK+ 2.x installed at C:\GTK ?

@nalbion
Copy link

nalbion commented May 17, 2014

I'm having a similar problem building on Windows 7 64bit. I've installed GTK 3.6.4 64bit and GTK 2.24 32bit but neither of them worked.

I then installed GTK 2.22 64bit and that works. It would be good if the canvas build could provide more of a hint, then this issue could be closed.

@petarov
Copy link

petarov commented May 17, 2014

@nalbion Are you running a 64bit nodejs? I guess both GTK and nodejs need either be 64bit or 32bit to compile successfully. This is actually hinted in the wiki link that @rvagg posted above.

@cyrusdavid
Copy link

Does it also need exactly the 2010 version of visual c++?

@vweevers
Copy link
Contributor

I've added a clarification to the wiki about GTK + Node.js bitness, in @petarov's words.

@vohof No, it doesn't require 2010 per se - but it is (or at least used to be) the safest option.

@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...

@LinusU LinusU closed this as completed Feb 15, 2016
@ghost
Copy link

ghost commented Oct 30, 2017

unzipping GTK to C:\GTK worked, it is missing from the automatic instructions you still have to download GTK separately.

@zorobabel How is your solution different than the instructions? (What can be updated in the wiki?) It isn't clear from the "Environment" heading if those are pre-requisites or will be installed by the time you're done.

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

No branches or pull requests

9 participants