2 bethyao bethyao 于 2014.12.02 20:31 提问

ubuntu node 安装 canvas不成功

用npm安装canvas用的这两句代码sudo apt-get install libcairo2-dev和npm install canvas
出现错误
sh: 1: node-waf: not found

npm ERR! canvas@0.10.2 preinstall: node-waf configure build
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the canvas@0.10.2 preinstall 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-waf configure build
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 3.8.0-29-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "canvas"
npm ERR! cwd /home/baobao/baobao/spriter
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
root@ubuntu:/home/baobao/baobao/spriter#
已经好几天,在线等,希望有懂的人告诉我

1个回答

Rocloud
Rocloud   Rxr 2014.12.02 21:48

npm install canvas 各种依赖,各种错误 转投npm install ccap 来生成验证码

他的依赖很多,最好按照官方wiki提供的文档来安装.
wiki文档地址: https://github.com/LearnBoost/node-canvas/wiki

wiki 提供的安装向导包括2部分,红框内的为不同操作系统需要安装的依赖. 红框下面是云环境需要安装的依赖.
其实我在博客中只是想生成一个验证码,涉及到的功能很小,于是网上查找替换方案,就这样发现了ccap ,眼前一亮的感觉!

以上转载

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!