npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-05-06T06_56_36_758Z-debug.log
root@iZ2ze9lvoscwcy6zptwugdZ:~# sudo npm install -g web3 --unsafe-perm=true --allow-root
用如下语句安装即可
sudo npm install -g web3 --unsafe-perm=true --allow-root