本文介绍了在 pkg-config 搜索路径中找不到包 cairo.Node j.s 安装画布问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 node 中安装画布模块时遇到问题..这似乎与 cairo 有关,我收到此错误...

I am having a problem installing installing the canvas module in node..It seems to be something with cairo I am getting this error...

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

> [email protected] install /Users/plimb/Desktop/motion-therapy/node_modules/canvas
> node-gyp rebuild

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_cairo_freetype.sh' returned exit status 0. 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:424:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/plimb/Desktop/motion-therapy/node_modules/canvas
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

我不确定这一切意味着什么!感谢您的帮助!例如,如何在 pkg_config_path 环境变量中设置 mkdir cairo pc?

I'm not sure what it all means! Would appreciate any help!For example how to a mkdir cairo pc in the pkg_config_path environment variable?

推荐答案

@Epistemex 的 link 帮我解决了问题.

Had the same problem and @Epistemex's link helped me troubleshoot it.

... 您需要安装 libcairo2-devlibjpeg-devlibgif-dev 包...

sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev

这篇关于在 pkg-config 搜索路径中找不到包 cairo.Node j.s 安装画布问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-31 23:37