npm install canvas
发布于 8 年前 作者 Tonykeng 7557 次浏览 来自 问答
not found: ldconfig
gyp: Call to './util/has_lib.sh pangocairo' 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:355:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/wulian/Node/open-api/node_modules/canvas
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.9
npm ERR! code ELIFECYCLE

npm ERR! canvas@1.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.3.0 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!     /Users/wulian/Node/open-api/npm-debug.log

求助,google了半天,无解 求教。node 新手。 mac 环境

6 回复

高手指点下啊,刚从ruby转到node 一堆问题~

canvas需要编译,看下有没有装python2.7和编译工具 自豪地采用 CNodeJS ionic

看第一条,ldconfig没装

来自炫酷的 CNodeMD

@klesh 是ldconfig权限的问题,虽然没搞定ldconfig 是什么鬼,但是总算解决了,node社区跟ruby社区一样,虽然小众,但是很给力~

@Tonykeng 这个后来怎么解决的?我试过用 sudo 依然解决不了

@superRaytin https://github.com/Automattic/node-canvas

1, brew install pkg-config cairo libpng jpeg giflib 2, npm i canvas

回到顶部