无法在mac OS X El Capitan

时间:2016-03-03 08:38:14

标签: fabricjs

我无法在我的mac上安装fabric.js.

npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "fabric"
npm ERR! node v4.2.1
npm ERR! npm  v3.8.0
npm ERR! code ELIFECYCLE

npm ERR! canvas@1.1.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.1.6 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs canvas
npm ERR! Or if that isn't available, 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/AirShaos/Documents/dev/prospace/repo/prospace_strongloop_cms/npm-debug.log
npm ERR! code 1

该错误基本上与&node-gyp'有关,我根本不知道。我的节点版本是4.2.1,npm版本是3.8.0。有没有人遇到这个问题?

1 个答案:

答案 0 :(得分:0)

这是节点画布安装错误。请参考此处获取说明。

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

可能你必须跑:

brew install pkg-config cairo libpng jpeg giflib