visual-studio-2010 - 在 Windows x64 上安装 node-canvas 平台 x64 无效?

标签 visual-studio-2010 node.js canvas

我在安装 node-canvas 时遇到问题在我运行 Windows 7 64 位的 Windows 机器上。我已经关注了Instructions我也尝试过使用 Visual C++ Professional(试用版),但这也没有帮助。

当我输入 npm install canvas 时,它会给出以下内容:

npm http GET https://registry.npmjs.org/canvas
npm http 304 https://registry.npmjs.org/canvas
npm http GET https://registry.npmjs.org/canvas/-/canvas-0.13.1.tgz
npm http 200 https://registry.npmjs.org/canvas/-/canvas-0.13.1.tgz

>canvas@0.13.1 install C:\wamp\www\node_modules\canvas
>node-gyp rebuild

C:\wamp\www\node_modules\canvas>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
canvas@0.13.1 install C:\wamp\www\node_modules\canvas
> node-gyp rebuild


C:\wamp\www\node_modules\canvas>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild 
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'canvas.vcxproj' is invalid.  Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [C:\wamp\www\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 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:232:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child:process.js:678:10)
gyp ERR! Syste, Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\wamp\www\node_modules\canvas
gyp ERR! node -v v0.8.16
gyp ERR! node-gyp -v v0.7.3
gyp ERR! not ok
canvas@0.13.1 node_modules\canvas

(我希望我正确地输入了控制台输出,因为我必须在控制台上输入它,因为没有找到日志,而且 Windows 显然不允许您将完整的 cmd 输出记录到文件中)

最佳答案

我通过用 VS2012(两个 Express 版本)替换 VS2010 解决了同样的问题。

关于visual-studio-2010 - 在 Windows x64 上安装 node-canvas 平台 x64 无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14053974/

相关文章:

python - canvas.move(id, x, y) 不适用于箭头键

.net - 那么,既然 F# 已经开源,那么它又是怎么回事呢?

visual-studio - OpenCV 警告 : "function compiled as native"

c# - 网站 : MSB3270: There was a mismatch between the processor architecture

asp.net-mvc - 检查浏览器地理定位功能并获取纬度和经度

html - 幽灵自定义分页

xml2js : how is the output?

javascript - Canvas 、JS torch 效果: Fill background with a picture

javascript - 为什么这个模块不打印

javascript - 在 electron 的 vue-component 中打印 Canvas