目录
在linux环境安装canvas 报错如下
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pixman-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pixman-1' found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/root/nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
解决方法:
yarn config set canvas_binary_site "https://npm.taobao.org/mirrors/node-canvas-prebuilt/"
yarn config set canvas_binary_host_mirror "https://npm.taobao.org/mirrors/node-canvas-prebuilt/"