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

> scrypt@6.0.3 preinstall /home/myuser/web3v1sandbox/node_modules/scrypt
> node node-scrypt-preinstall.js


> scrypt@6.0.3 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 web3v1sandbox@1.0.0 No description
npm WARN web3v1sandbox@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
~/web3v1sandbox$ npm install web3

> scrypt@6.0.3 preinstall /home/myuser/web3v1sandbox/node_modules/scrypt
> node node-scrypt-preinstall.js


> scrypt@6.0.3 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 web3v1sandbox@1.0.0 No description
npm WARN web3v1sandbox@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 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