hellosean1025 / node-echarts

Generate chart by echarts in nodejs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

linux下安装报错ERR! canvas@1.6.5 install: `node-gyp rebuild`

huyangoo opened this issue · comments

查了好久还是没解决,请问怎么处理?

gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/node/0.10.24/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:789:12)
gyp ERR! System Linux 2.6.32-431.el6.x86_64
gyp ERR! command "node" "/usr/local/node/0.10.24/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/node/0.10.24/lib/node_modules/node-echarts/node_modules/canvas
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! canvas@1.6.5 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.6.5 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 Linux 2.6.32-431.el6.x86_64
npm ERR! command "/usr/local/node/0.10.24/bin/node" "/usr/local/node/0.10.24/bin/npm" "install" "node-echarts" "-g"
npm ERR! cwd /usr/local/bin
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/bin/npm-debug.log
npm ERR! not ok code 0

OS Command
OS X brew install pkg-config cairo pango libpng jpeg giflib
Ubuntu sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
Fedora sudo yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel
Solaris pkgin install cairo pango pkg-config xproto renderproto kbproto xextproto
Windows Instructions on our wiki

试试执行下上面的命令

make、gcc和gcc-c++等装了吗?有可能是nodejs的编译环境没弄好;或者是nodej的版本太高了。我一开始用了6.10.3,也出现了同样的问题,后来二进制安装了0.10.24,成功运行了。