npm安装web3.js

安装web3的时候发现用root安装也出现permission denied权限错误:

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/web3/node_modules/scrypt/build'
gyp ERR! System Darwin 17.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/web3/node_modules/scrypt
gyp ERR! node -v v9.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /Users/apple/.npm/_logs/2017-12-20T06_16_55_943Z-debug.log

解决方案 : sudo npm install -g web3 --unsafe-perm=true --allow-root

ETH地址:0xA10137eDA3d4844C6a3B0B51bF650CB115C19577

你可能感兴趣的:(npm安装web3.js)