The problem record

npm install

npm ERR! code 1
npm ERR! path /home/jenkins/workspace/${project-name}/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 2.7.5 found at "/bin/python"
npm ERR! gyp info spawn /bin/python
...
npm ERR! Package pangocairo was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pangocairo.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pangocairo' found
npm ERR! gyp: Call to 'pkg-config pangocairo --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! node -v v11.10.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
Copy the code

It seems that Linux server installation of Canvas Package dependency error, installation error, Google can not find any simple solution. At this point, I figured the YARN command would solve my problem, which is where YARN came in.

yarn
Copy the code

Problem solved.