2012-12-27 149 views
2

我在安裝node-canvas的Windows機器上運行Windows 7 64位時出現問題。我遵循Instructions,我也嘗試過使用Visual C++ Professional(試用版),但這也沒有幫助。無效的平臺x64在Windows x64上安裝node-canvas?

當我鍵入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 

>[email protected] 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. 
[email protected] 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 
[email protected] node_modules\canvas 

(我希望我打的控制檯輸出corretly,因爲我必須鍵入它關閉控制檯對沒有被發現日誌和Windows顯然不會讓你將完整的cmd輸出記錄到文件中)

+0

Quote:'節點x64是不穩定的'。關注項目的問題跟蹤器,你不是第一個遇到這個問題的人。 https://github.com/LearnBoost/node-canvas/issues/226 –

+1

@Hans Passant那麼我該怎麼辦?有沒有辦法完全切換到x86?(如在所有模塊中,節點本身和x86中的npm)。 – Wingblade

回答

1

我能夠通過將VS2010替換爲兩個Express版本的VS2010來解決同樣的問題。

相關問題