官网未提供在centos上安装node-canvas的教程,今天给搞定了。
Canvas graphics API backed by Cairo
https://www.npmjs.com/package/canvas
github.com/Automattic/node-canvas
sudo yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel
# 不推荐
# sudo yum install centos-release-scl
# sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
# sudo yum install devtoolset-3-gcc-c++
# scl enable devtoolset-3 bash
# 推荐
yum remove gcc gcc-g++
curl -Lks http://www.hop5.in/yum/el6/hop5.repo > /etc/yum.repos.d/hop5.repo
yum install gcc gcc-g++
gcc --version
https://www.npmjs.com/package/node-gyp
npm install -g node-gyp
#python (v2.7 recommended, v3.x.x is not supported)
npm install canvas