C:UsersAdministratorDesktophotchcms-master>npm i canvas
canvas@1.6.6 install C:UsersAdministratorDesktophotchcms-masternode_modulescanvas
node-gyp rebuild
C:UsersAdministratorDesktophotchcms-masternode_modulescanvas>if not defined npm_config_node_gyp (node "C:Program Filesnodejsnode_module
snpmbinnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild ) else (node "" rebuild )
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.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 hav
e specified a non-default Platform that doesn't exist for this project. [C:UsersAdministratorDesktophotchcms-masternode_modulescanvasbui
ldcanvas.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 Filesnodejsnode_modulesnpmnode_modulesnode-gyplibbuild.js:258:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"
"rebuild"
gyp ERR! cwd C:UsersAdministratorDesktophotchcms-masternode_modulescanvas
gyp ERR! node -v v8.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN hotchcms@0.0.1 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@1.6.6 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.6.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersAdministratorAppDataRoamingnpm-cache_logs2017-09-04T13_05_53_731Z-debug.log
直接设置了下载来源cnpm,这样就不用编译了,解决了。