1

I am trying to install web3 on ubuntu 16.04 vm and I get the below error.

npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated tar.gz@1.0.7: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar

> scrypt@6.0.3 preinstall /home/ltu/web3/node_modules/scrypt
> node node-scrypt-preinstall.js


> scrypt@6.0.3 install /home/ltu/web3/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ltu/web3/node_modules/scrypt/build'
gyp ERR! System Linux 4.13.0-38-generic
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 /home/ltu/web3/node_modules/scrypt
gyp ERR! node -v v9.10.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/home/ltu/web3/package.json'
npm WARN web3 No description
npm WARN web3 No repository field.
npm WARN web3 No README data
npm WARN web3 No license field.

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

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ltu/.npm/_logs/2018-04-20T10_50_03_804Z-debug.log

Any help please!!!

  • try first to update npm – Badr Bellaj Apr 21 '18 at 7:59
  • npm is up to date. Installed version - V 5.8.0. I tried to restart the VM and it worked. :):) – K Kolluru Apr 21 '18 at 8:30
1

Permissions of your node_modules is with root. This happens when you install some package globally using sudo or as root. In order to be able to install now, you need to run the install command with sudo

sudo npm install web3 -g
| improve this answer | |
  • 1
    i ran it with sudo only. The issue was with the version of npm and it is resolved now. – K Kolluru Apr 21 '18 at 12:43
0

If you use sudo to install packages, you will get "EACCES: permission denied" error next time when you install packages, because those packages installed via sudo will have root as their owner, instead of you being the owner.

install web3.js via yarn:

$ yarn add web3 --dev

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.