【发布时间】:2014-04-09 05:06:39
【问题描述】:
我对在命令行中工作还很陌生。我有一个正在使用 gulp 设置的项目,并且安装了 gulp 并成功编译了 sass 文件。但是,我无法通过以下方式安装画布:
$ npm install canvas
我需要安装画布,因为 css-sprite 必须运行依赖项。我收到以下错误。我已经安装了 cairo、quartz 和 homebrew。我研究了其他票证并尝试运行export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig 并再次安装。我没有运气,也不知道在尝试排除故障时还能做什么。
这是错误...
npm http GET https://registry.npmjs.org/canvas
npm http 304 https://registry.npmjs.org/canvas
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan
canvas@1.1.3 install /usr/local/lib/node_modules/canvas
node-gyp rebuild
./util/has_cairo_freetype.sh: line 4: pkg-config: command not found
gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0.
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/canvas
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! canvas@1.1.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.1.3 install script.
npm ERR! This is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls canvas
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "canvas"
npm ERR! cwd /Users/kylebebeau/websites/ls/code/templates/ls3
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/kylebebeau/websites/ls/code/templates/ls3/npm-debug.log
npm ERR! not ok code 0
任何帮助或指导将不胜感激。
【问题讨论】: