解决Centos7安装npm之后安装web3出错
在安装了node.js之后,想在Linux中继续安装web3,发现一直出现以下问题
bufferutil@4.0.5 install /root/dapp/ganacheTest/node_modules/bufferutil
node-gyp-build
sh: node-gyp-build: 未找到命令
npm WARN enoent ENOENT: no such file or directory, open /root/dapp/ganacheTest/package.json
npm WARN ganacheTest No description
npm WARN ganacheTest No repository field.
npm WARN ganacheTest No README data
npm WARN ganacheTest No license field.
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! bufferutil@4.0.5 install: `node-gyp-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the bufferutil@4.0.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-11-21T05_12_45_801Z-debug.log
【root@ ganacheTest】# npm install web3@^0.20.0
npm ERR! Error while executing:
一直进行重试还是有问题,然后查询资料发现我node版本可能不适合,一开始装的是node-v10.14.1-linux版本,后面换成了16.13.0版本的,然后重新安装就没有问题了。