BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / java-script / #1020同步于 2016/12/20
该镜像源已超过 30 天没有更新,可能在源站已被删除。
JavaScript机器人发帖

【问题】win10装node.js的canvas

led941108
2016/12/20镜像同步4 回复
装canvas各种依赖,python, vs, GTK全部都装了,然后npm install -g canvas报错如下 > canvas@1.6.2 install E:\node.js\node_cache\node_modules\canvas > node-gyp rebuild E:\node.js\node_cache\node_modules\canvas>if not defined npm_config_node_gyp (node "E:\node.js\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) Warning: Missing input files: C:\GTK\bin\libfreetype-6.dll 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [E:\node.js\node _cache\node_modules\canvas\build\canvas.vcxproj] gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (E:\node.js\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12) gyp ERR! System Windows_NT 10.0.14393 gyp ERR! command "E:\\node.js\\node.exe" "E:\\node.js\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd E:\node.js\node_cache\node_modules\canvas gyp ERR! node -v v6.2.0 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok npm ERR! Windows_NT 10.0.14393 npm ERR! argv "E:\\node.js\\node.exe" "E:\\node.js\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "canvas" npm ERR! node v6.2.0 npm ERR! npm v3.8.9 npm ERR! code ELIFECYCLE npm ERR! canvas@1.6.2 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the canvas@1.6.2 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, 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 information on how to open an issue for this project with: npm ERR! npm bugs canvas npm ERR! Or if that isn't available, 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! E:\node.js\radio\radioplatform\npm-debug.log 求懂的人指点迷津,搞了一天都没搞好
订阅后,新回复会通过你的通知中心匿名送达。
4 条回复
zt4027050机器人#1 · 2016/12/20
我装上了,但是没有用,生成不了图片,最终还是在linux下跑起来的。不过我是在win7下装的https://github.com/Automattic/node-canvas/wiki/Installation---Windows
led941108机器人#2 · 2016/12/20
我也是按这个帖子装的, 但是就是报上述错误, 所以意思是即使windows装上了也会有问题是吗?麻烦问一下你是装的linux虚拟机还是双系统?感觉windows做web开发好蛋疼。。 【 在 zt4027050 的大作中提到: 】 : 我装上了,但是没有用,生成不了图片,最终还是在linux下跑起来的。不过我是在win7下装的https://github.com/Automattic/node-canvas/wiki/Installation---Windows
zt4027050机器人#3 · 2016/12/23
windows开发环境确实难搞...我在虚拟机也装上了,在公司测试服务器也装上了 【 在 led941108 的大作中提到: 】 : 我也是按这个帖子装的, 但是就是报上述错误, 所以意思是即使windows装上了也会有问题是吗?麻烦问一下你是装的linux虚拟机还是双系统?感觉windows做web开发好蛋疼。。
zhoucongwen机器人#4 · 2017/1/18
如果是Windows 10 1611版本的话可以试一下Bash on Ubuntu on windows