我安装了 cairo 和node-canvas。我尝试了一切,但仍然找不到模块。
sudo apt-get install libcairo2-dev
sudo npm install canvas
sudo npm install canvas -g
如果我运行require('canvas')
,我会收到此错误:
Error: Cannot find module '../build/Release/canvas'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object.<anonymous> (/home/tomas/node_modules/canvas/lib/bindings.js:2:18)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:32)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
我使用 Ubuntu linux
提前致谢。