2014-12-05 41 views
1

我在Windows 8计算机上安装Canvas时遇到问题。在Windows 8计算机上安装Cairo和Canvas

我需要用猪描述符,为此,我需要安装帆布但是,当我尝试“故宫安装帆布”我得到这个错误:

c:\users\omri\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot 
open include file: 'cairo/cairo.h': No such file or directory (..\src\CanvasPatt 

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 (C:\Program Files\nodejs\node_modules\ 
npm\node_modules\node-gyp\lib\build.js:267:23) 
gyp ERR! stack  at ChildProcess.emit (events.js:98:17) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (child_process.js:810: 
12) 
gyp ERR! System Windows_NT 6.2.9200 
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:\iolo\scipy-0.14.0\node_modules\canvas 
gyp ERR! node -v v0.10.33 
gyp ERR! node-gyp -v v1.0.1 
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.2.9200 
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod 
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "canvas" 
npm ERR! cwd C:\iolo\scipy-0.14.0 
npm ERR! node -v v0.10.33 
npm ERR! npm -v 1.4.28 
npm ERR! code ELIFECYCLE 
npm ERR! not ok code 0 

我该如何解决这个问题?

+0

您是否安装了Visual C++ 2010或更新版本? – mscdex 2014-12-05 14:58:54

+0

是的,我确实安装了它。 @mscdex – 2014-12-05 15:04:08

+0

你安装了哪个版本? – mscdex 2014-12-05 15:12:40

回答

1

要修复缺失的cairo库错误,请按照说明在canvas模块的wiki here中安装cairo。

+0

非常感谢:) – 2014-12-05 17:28:48

0

画布在某处被硬编码(或者可能从node-gyp获取提示)只接受名为GTK的GTK2目录。所以它似乎顺利提取GTK2到C:\GTK,否则你会追着丢失的头文件。

相关问题