gyp ERR! node -v v8.1.0
gyp ERR! node-gyp -v v9.1.0
gyp ERR! Node-gyp failed to build your package.
gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
解决方法1: 更新nodejs版本,v8.1.0->v14.20.0
nvm install 14.20.0
nvm use 14.20.0
遇到问题:卡在node ./XX.js
> truffle@5.5.22 postinstall /home/XXX/.nvm/versions/node/v14.20.0/lib/node_modules/truffle
> node ./scripts/postinstall.js
解决方法:npm install 前加sudo