jetsung npm 使用时(canvas)node-gyp rebuild 错误 npm ERR! code 1 npm ERR! path /home/skiy/projects/react/my-app/node_modules/canvas npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! Package pixman-1 was not found in the pkg-config search path. npm ERR! Perhaps you should add the directory containing `pixman-1.pc' npm ERR! to the PKG_CONFIG_PATH environment variable npm ERR! No package 'pixman-1' found npm ERR! gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/home/skiy/projects/react/my-app/node_modules/node-gyp/lib/configure.js:351:16) npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:400:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) npm ERR! gyp ERR! System Linux 5.11.0-36-generic npm ERR! gyp ERR! command "/home/skiy/.node/bin/node" "/home/skiy/projects/react/my-app/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /home/skiy/projects/react/my-app/node_modules/canvas npm ERR! gyp ERR! node -v v14.17.6 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! /home/skiy/.npm/_logs/2021-09-23T13_40_47_720Z-debug.log 解决 sudo apt install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev