Open gfdhrt opened 6 years ago
同上
安装编译canvas失败了,在 https://github.com/Automattic/node-canvas/issues 有很多类似的问题。
Windows下测试遇到了同样的问题,解决方案在canvas install wiki:
我使用的Manual设置Canvas环境,成功了。
2,3 就是下载解压到c盘,不要改路径。
PS, 如果没有安装VS,可以使用windows-build-tools
ubuntu 16.4 同样问题
`
npm install
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
canvas@1.6.13 install /home/james/app/Chrome_12306/node_modules/canvas node-gyp rebuild
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing cairo.pc' to the PKG_CONFIG_PATH environment variable No package 'cairo' found gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error:
gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/home/james/.nvm/versions/node/v10.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.13.0-41-generic
gyp ERR! command "/home/james/.nvm/versions/node/v10.12.0/bin/node" "/home/james/.nvm/versions/node/v10.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/james/app/Chrome_12306/node_modules/canvas
gyp ERR! node -v v10.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN Chrome-12306@2.1.0 No repository field.
npm WARN Chrome-12306@2.1.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@1.6.13 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.6.13 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! /home/james/.npm/_logs/2019-01-08T02_16_16_663Z-debug.log
`
npm版本5.5.1
——————————————————————————————————————————————
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "4.0"。 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 (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23) gyp ERR! stack at ChildProcess.emit (events.js:159:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12) gyp ERR! System Windows_NT 10.0.16299 gyp ERR! command "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\localhost\www\Chrome_12306\node_modules\canvas gyp ERR! node -v v9.2.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok npm WARN Chrome-12306@2.1.0 No repository field. npm WARN Chrome-12306@2.1.0 No license field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! canvas@1.6.9 install:
node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the canvas@1.6.9 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:\Users\i\AppData\Roaming\npm-cache_logs\2018-01-15T08_23_55_012Z-debug.log PS D:\localhost\www\Chrome_12306> npm install/m —————————————————————————————————————————————— log日志错误信息 warn Chrome-12306@2.1.0 No repository field. 1100 warn Chrome-12306@2.1.0 No license field. 1101 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents): 1102 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})