Web3.js: npm install web3 error on ubuntu 16.04

Created on 28 Sep 2017  路  17Comments  路  Source: ChainSafe/web3.js

npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b browserifyCompatible git://github.com/frozeman/WebSocket-Node.git /home/ubuntu/.npm/_cacache/tmp/git-clone-49c1c456
npm ERR! /home/ubuntu/.npm/_cacache/tmp/git-clone-49c1c456/.git: Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-09-28T10_56_30_865Z-debug.log

ubuntu@ip-*:/var/www/ethereum_demo$ vi /home/ubuntu/.npm/_logs/2017-09-28T10_56_30_865Z-debug.log

800 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "web3"
801 verbose node v8.6.0
802 verbose npm v5.3.0
803 error code 1
804 error Command failed: /usr/bin/git clone --depth=1 -q -b browserifyCompatible git://github.com/frozeman/WebSocket-Node.git /home/ubuntu/.npm/_cacache/tmp/git-clone-49c1c456
804 error /home/ubuntu/.npm/_cacache/tmp/git-clone-49c1c456/.git: Permission denied

support

Most helpful comment

OK. I gave up with npm install pulling it and I downloaded the zip of the release from GitHub. Put it in my node_modules folder and ran npm install on it. That seems to allow it to finish the install process. It seems to be working fine.

All 17 comments

Trying to set this up as well, but getting the same error. I tried running it manually sticking a nice lil "sudo" infront of it, but the installing won't progress past this problem.

same here...

same problem here as well

I'm not 100% sure this is the solution, or a possible solution but maybe someone could test this out since it did work for me. Try running:

npm cache clear

..to make sure that npm does stuff correctly. I might have changed something else that I can't recall that made the difference, but maybe it was the cache clear that saved me.

I have the same issue. Just npm cache clear did not work for me unfortunately. It would be great if you could recall what else you did. Could you maybe check you console history to find out?

OK. I gave up with npm install pulling it and I downloaded the zip of the release from GitHub. Put it in my node_modules folder and ran npm install on it. That seems to allow it to finish the install process. It seems to be working fine.

Sorry, I don't have the logs left and I honestly think it was just the npm cache clear in my case, but glad you got it working!

same problem.

same issue on mac os sierra, npm v5. Anyone found a real cause of the problem?

alrite, this is probably happening because npm creates cache folders with ownership/permissions somehow not writable for git, so git dependency can not be written to cache folder. Too lazy to confirm what is exactly going on there.

Quick solution is: switch to npm version 4 instead of 5.

It appears like v5 release of npm is not usable, this is not the first time I can't load dependencies that worked with previous npm versions.

similar problem, Mac OS High Sierra, attempting to npm install -g web3

apparent quick work-around:

npm install web3

(do not use -g parameter, do not sudo, install for active user only not as global npm package)

I have exactly the same issue, tried cleaning the cache and installing the depencies on their own, to no avail.

npm install [email protected]

sudo npm install -g web3 --unsafe-perm=true --allow-root this worked for me in ubuntu 18.04.01

Manually execute git clone,and chang git:// to https://, and proceed with your npm install

sudo npm install -g web3 --unsafe-perm=true --allow-root this work for me

Closed because of the ongoing clean up of the issue list. Feel free to ask this in our gitter channel or on stackoverflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xpepermint picture xpepermint  路  3Comments

zamoore picture zamoore  路  3Comments

ragnu picture ragnu  路  3Comments

connectdotz picture connectdotz  路  3Comments

joeriexelmans picture joeriexelmans  路  3Comments