Trying to install web3 on Ubuntu 17.04 node version 8.2.0 and npm version 5.6.0
~/web3v1sandbox$ npm install web3
> [email protected] preinstall /home/myuser/web3v1sandbox/node_modules/scrypt
> node node-scrypt-preinstall.js
> [email protected] install /home/myuser/web3v1sandbox/node_modules/scrypt
> node-gyp rebuild
/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp: 5: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp: /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js: Permission denied
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 126
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.
~/web3v1sandbox$ npm install web3
> [email protected] preinstall /home/myuser/web3v1sandbox/node_modules/scrypt
> node node-scrypt-preinstall.js
> [email protected] install /home/myuser/web3v1sandbox/node_modules/scrypt
> node-gyp rebuild
/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp: 5: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp: /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js: Permission denied
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 126
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.
did you check here? I've found a solution there for similar problem I had on mac.
It's likely that node was installed as root which is why you're running into a permission issue. Try running command with sudo.
$ sudo npm install --save package_name --unsafe-perm=true --allow-root
This works for me on my Linux Mint/Ubuntu system
@zidzid1234
Your solution worked when I added web3 at the end, cheers! (maybe it was obvious)
i deleted .npm from home directory by type ctl-h and then deleted the .npm folder and again run the npm install web3 (ubuntu 16.04)
and if not worked just delete .npm from home directory and type
sudo su
then run
npm install web3
Most helpful comment
$ sudo npm install --save package_name --unsafe-perm=true --allow-root
This works for me on my Linux Mint/Ubuntu system