Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install web3 node-gyp permission denied #1232

Closed
aas312 opened this issue Dec 14, 2017 · 5 comments
Closed

npm install web3 node-gyp permission denied #1232

aas312 opened this issue Dec 14, 2017 · 5 comments

Comments

@aas312
Copy link

aas312 commented Dec 14, 2017

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.

@makc
Copy link

makc commented Dec 23, 2017

did you check here? I've found a solution there for similar problem I had on mac.

@christopherdro
Copy link

It's likely that node was installed as root which is why you're running into a permission issue. Try running command with sudo.

@ghost
Copy link

ghost commented Mar 16, 2018

$ sudo npm install --save package_name --unsafe-perm=true --allow-root
This works for me on my Linux Mint/Ubuntu system

@jctaillandier
Copy link

@zidzid1234
Your solution worked when I added web3 at the end, cheers! (maybe it was obvious)

@chandu333
Copy link

chandu333 commented Jul 27, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants