首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在NPM不工作的情况下安装Node Canvas

在NPM不工作的情况下安装Node Canvas
EN

Stack Overflow用户
提问于 2015-03-16 20:53:24
回答 1查看 1.8K关注 0票数 0

我正在尝试在带有LAMP的CentOs 6上安装node-canvas。我已经安装并更新了Node JS和nmp到最新版本。

当我运行命令npm install canvas时,我只得到以下错误:

代码语言:javascript
复制
[root@localhost tmp]# sudo npm install canvas

> canvas@1.2.1 install /tmp/node_modules/canvas
> node-gyp rebuild

Package pangocairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `pangocairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pangocairo' found
gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1. 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/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 2.6.32-504.8.1.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/node_modules/canvas
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 2.6.32-504.8.1.el6.x86_64
npm ERR! argv "node" "/usr/bin/npm" "install" "canvas"
npm ERR! node v0.10.36
npm ERR! npm  v2.7.1
npm ERR! code ELIFECYCLE

npm ERR! canvas@1.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.2.1 install script 'node-gyp rebuild'.
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! Please include the following file with any support request:
npm ERR!     /tmp/npm-debug.log
EN

回答 1

Stack Overflow用户

发布于 2015-03-16 20:58:51

在安装node canvas之前,您需要安装cairo和其他一些库。

只需使用以下命令:

yum install -y cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29077320

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档