Ubuntu下nodejs安装canvas出错

npm install canvas

提示

> [email protected] install /root/Android-Material-Icon-Generator-master/node_modules/canvas

> node-gyp rebuild

Package cairo was not found in the pkg-config search path.

Perhaps you should add the directory containing `cairo.pc'

to the PKG_CONFIG_PATH environment variable

No package 'cairo' found

原因是缺少cairo包,运行

sudo apt-getinstall libcairo2-dev libjpeg-dev libgif-dev

即可

你可能感兴趣的:(Ubuntu下nodejs安装canvas出错)