简体   繁体   中英

Invalid platform x64 installing node-canvas on windows x64?

I'm having a problem installing node-canvas on my windows machine which runs windows 7 64-bit. I've followed the Instructions and I also tried it with Visual C++ Professional (the trial version), but that didn't help either.

When I type npm install canvas it gives me the following:

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

(I hope I typed the console output corretly, since I had to type it off of the console for there were no logs to be found and windows apparently doesn't let you log the complete cmd output to a file)

我可以通过将两个Express版本的VS2010替换为VS2010来解决相同的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM