web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

npm install web3 error

Open subhodi opened this issue 8 years ago • 30 comments

npm install web3 command fails to install web3, following error is thrown npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support npm WARN deprecated [email protected]: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm ERR! Error while executing: npm ERR! /usr/bin/git ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git npm ERR! npm ERR! fatal: unable to access 'https://github.com/frozeman/WebSocket-Node.git/': Failed to connect to github.com port 443: Connection timed out npm ERR! npm ERR! exited with error code: 128

Windows and Ubuntu returns same error.

subhodi avatar Dec 06 '17 09:12 subhodi

I'm getting the same error.

shadowcodex avatar Dec 07 '17 02:12 shadowcodex

To me it also contains the following.

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git
npm ERR! 
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.255.113]: errno=Connection timed out
npm ERR! github.com[1: 192.30.255.112]: errno=Connection timed out
npm ERR! 
npm ERR! 
npm ERR! exited with error code: 128

First I thought it was some firewall issue but I guess it could not be, as this issue is posted here.

leehankyeol avatar Jan 02 '18 11:01 leehankyeol

Could this happen because it is calling git://github.com/frozeman/WebSocket-Node.git instead of https://github.com/frozeman/WebSocket-Node.git?

kecondezo avatar Jan 02 '18 21:01 kecondezo

Hey what i did in linux was to force git to use https instead of git protocol with this command git config --global url.https://github.com/.insteadOf git://github.com/ as per https://stackoverflow.com/questions/1722807/how-to-convert-git-urls-to-http-urls answer. After this change it worked for me 👍

[root@a66afa701d3e _logs]# git config --global url.https://github.com/.insteadOf git://github.com/
[root@a66afa701d3e coursetro-eth]# npm install web3 --save
npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated [email protected]: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

>scrypt%406.0.3 preinstall /shared/gclie/code/coursetro-eth/node_modules/scrypt
>node node-scrypt-preinstall.js`

> [email protected] install /shared/gclie/code/coursetro-eth/node_modules/scrypt
> node-gyp rebuild

make: Entering directory `/shared/gclie/code/coursetro-eth/node_modules/scrypt/build'
  SOLINK_MODULE(target) Release/obj.target/copied_files.node
  COPY Release/copied_files.node
  CC(target) Release/obj.target/scrypt_wrapper/src/util/memlimit.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/keyderivation.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/pickparams.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/hash.o
  AR(target) Release/obj.target/scrypt_wrapper.a
  COPY Release/scrypt_wrapper.a
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt_smix.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/warnp.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/alg/sha256.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/insecure_memzero.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/scryptenc/scryptenc_cpuperf.o
  AR(target) Release/obj.target/scrypt_lib.a
  COPY Release/scrypt_lib.a
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_common.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_sync.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf_async.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf_sync.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf-verify_sync.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf-verify_async.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_hash_sync.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_hash_async.o
  CXX(target) Release/obj.target/scrypt/scrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/scrypt.node
  COPY Release/scrypt.node
make: Leaving directory `/shared/gclie/code/coursetro-eth/node_modules/scrypt/build'

> [email protected] install /shared/gclie/code/coursetro-eth/node_modules/sha3
> node-gyp rebuild

make: Entering directory `/shared/gclie/code/coursetro-eth/node_modules/sha3/build'
  CXX(target) Release/obj.target/sha3/src/addon.o
../src/addon.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE SHA3Hash::New(Nan::NAN_METHOD_ARGS_TYPE)':
../src/addon.cpp:59:58: warning: 'v8::Local<v8::Object> v8::Function::NewInstance(int, v8::Local<v8::Value>*) const' is deprecated (declared at /root/.node-gyp/8.9.3/include/node/v8.h:3831): Use maybe version [-Wdeprecated-declarations]
    info.GetReturnValue().Set(cons->NewInstance(argc, argv));
                                                          ^
  CXX(target) Release/obj.target/sha3/src/displayIntermediateValues.o
  CXX(target) Release/obj.target/sha3/src/KeccakF-1600-reference.o
  CXX(target) Release/obj.target/sha3/src/KeccakNISTInterface.o
  CXX(target) Release/obj.target/sha3/src/KeccakSponge.o
  SOLINK_MODULE(target) Release/obj.target/sha3.node
  COPY Release/sha3.node
make: Leaving directory `/shared/gclie/code/coursetro-eth/node_modules/sha3/build'

> [email protected] install /shared/gclie/code/coursetro-eth/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/shared/gclie/code/coursetro-eth/node_modules/websocket/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory `/shared/gclie/code/coursetro-eth/node_modules/websocket/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 309 packages in 110.462s

kecondezo avatar Jan 03 '18 14:01 kecondezo

@kecondezo That is the cause, but it is a bad solution as it will apply globally so possibly your own github repos or so that you might access or only can access through git/ssh will then also use https.

step21 avatar Jan 09 '18 18:01 step21

Same error here

remiroyc avatar Jan 12 '18 12:01 remiroyc

:) 👍 @step21 probably you are right about the solution I am not a git expert or node.js expert just a beginner. It is not the best but it is what I did to run my POC and it worked. I do not see any other solution around. There is any other way to do it without the global specification?

kecondezo avatar Jan 12 '18 16:01 kecondezo

Hi,

I'm also experiencing some issues: I'm trying to install web3 to use on a heroku dyno, but even when trying to run the app locally after installing the latest version of web3 (npm install --save [email protected]). I get the following error when trying to run the node server, 'Cannot find module './build/Release/scrypt''.

ChelseaDan avatar Jan 23 '18 22:01 ChelseaDan

So I had the exact error message as you did, and searched the hundreds of issues from ethereum/web3 page. After trying many different ones, it worked with this line:

sudo npm install --save package_name --unsafe-perm=true --allow-root web3

*Note I am working on Bash Ubuntu CLI on Windows 10

jctaillandier avatar Mar 25 '18 01:03 jctaillandier

This seems to be a problem in Windows 10 system. I get the issue when i use Win 10 or VM Linux in Win 10. I am not facing the issue with Windows 8.1 or VM Linux in Win 8.1. The quickest way out would be to use npm install web3@^0.20.0. This solved the issue in Win 10 and Ubuntu VM on Win 10.

veerbala82 avatar Jul 16 '18 03:07 veerbala82

@veerbala82 but web3 v20.0 has totally different APIs than v1.0

subhodi avatar Jul 16 '18 05:07 subhodi

Oh Yes. I havent tried it out yet. But v1.0 beta seems to install in VM Ubuntu in Win 8.1 without any issues.

veerbala82 avatar Jul 16 '18 06:07 veerbala82

Working solution: [email protected] [email protected]

STEP1: mv ~/.npm ~/.npm-old STEP2: remove node_modules STEP3: set your user as admin - so you can call without sudo STEP4: npm install (without sudo!!!)

In my case I mixed my permissions in .npm because I used sometimes sudo and sometimes not... this definitelly solved this issue

peteroravec avatar Sep 11 '18 07:09 peteroravec

@nividaI think we can close this issue. Tested in Ubuntu, I could install web3 without any issues.

subhodi avatar Sep 12 '18 06:09 subhodi

Problem is still occuring, cannot install (neither with NPM or yarn):

error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads git://github.com/frozeman/WebSocket-Node.git
Directory: /Users/harmvandendorpel/Projects/Nesting/app
Output:
fatal: unable to connect to github.com:
github.com[0: 192.30.253.112]: errno=Operation timed out
github.com[1: 192.30.253.113]: errno=Operation timed out
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

harmvandendorpel avatar Sep 14 '18 09:09 harmvandendorpel

(on mac) Try this: sudo chown -R $(whoami) ~/.npm

and run NPM install without sudo npm install

peteroravec avatar Sep 14 '18 09:09 peteroravec

@streamer thanks but still hangs on:

⸨    ░░░░░░░░░░░░░░⸩ ⠧ fetchMetadata: sill resolveWithNewModule [email protected] checking installable status

harmvandendorpel avatar Sep 14 '18 09:09 harmvandendorpel

Hey what i did in linux was to force git to use https instead of git protocol with this command git config --global url.https://github.com/.insteadOf git://github.com/ as per https://stackoverflow.com/questions/1722807/how-to-convert-git-urls-to-http-urls answer. After this change it worked for me 👍

[root@a66afa701d3e _logs]# git config --global url.https://github.com/.insteadOf git://github.com/
[root@a66afa701d3e coursetro-eth]# npm install web3 --save
npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated [email protected]: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

>scrypt%406.0.3 preinstall /shared/gclie/code/coursetro-eth/node_modules/scrypt
>node node-scrypt-preinstall.js`

> [email protected] install /shared/gclie/code/coursetro-eth/node_modules/scrypt
> node-gyp rebuild

make: Entering directory `/shared/gclie/code/coursetro-eth/node_modules/scrypt/build'
  SOLINK_MODULE(target) Release/obj.target/copied_files.node
  COPY Release/copied_files.node
  CC(target) Release/obj.target/scrypt_wrapper/src/util/memlimit.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/keyderivation.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/pickparams.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/hash.o
  AR(target) Release/obj.target/scrypt_wrapper.a
  COPY Release/scrypt_wrapper.a
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt_smix.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/warnp.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/alg/sha256.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/insecure_memzero.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/scryptenc/scryptenc_cpuperf.o
  AR(target) Release/obj.target/scrypt_lib.a
  COPY Release/scrypt_lib.a
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_common.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_sync.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf_async.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf_sync.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf-verify_sync.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_kdf-verify_async.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_hash_sync.o
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_hash_async.o
  CXX(target) Release/obj.target/scrypt/scrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/scrypt.node
  COPY Release/scrypt.node
make: Leaving directory `/shared/gclie/code/coursetro-eth/node_modules/scrypt/build'

> [email protected] install /shared/gclie/code/coursetro-eth/node_modules/sha3
> node-gyp rebuild

make: Entering directory `/shared/gclie/code/coursetro-eth/node_modules/sha3/build'
  CXX(target) Release/obj.target/sha3/src/addon.o
../src/addon.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE SHA3Hash::New(Nan::NAN_METHOD_ARGS_TYPE)':
../src/addon.cpp:59:58: warning: 'v8::Local<v8::Object> v8::Function::NewInstance(int, v8::Local<v8::Value>*) const' is deprecated (declared at /root/.node-gyp/8.9.3/include/node/v8.h:3831): Use maybe version [-Wdeprecated-declarations]
    info.GetReturnValue().Set(cons->NewInstance(argc, argv));
                                                          ^
  CXX(target) Release/obj.target/sha3/src/displayIntermediateValues.o
  CXX(target) Release/obj.target/sha3/src/KeccakF-1600-reference.o
  CXX(target) Release/obj.target/sha3/src/KeccakNISTInterface.o
  CXX(target) Release/obj.target/sha3/src/KeccakSponge.o
  SOLINK_MODULE(target) Release/obj.target/sha3.node
  COPY Release/sha3.node
make: Leaving directory `/shared/gclie/code/coursetro-eth/node_modules/sha3/build'

> [email protected] install /shared/gclie/code/coursetro-eth/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/shared/gclie/code/coursetro-eth/node_modules/websocket/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory `/shared/gclie/code/coursetro-eth/node_modules/websocket/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 309 packages in 110.462s

This worked in Windows too!

reddysant avatar Oct 06 '18 19:10 reddysant

This seems to be a problem in Windows 10 system. I get the issue when i use Win 10 or VM Linux in Win 10. I am not facing the issue with Windows 8.1 or VM Linux in Win 8.1. The quickest way out would be to use npm install web3@^0.20.0. This solved the issue in Win 10 and Ubuntu VM on Win 10.

genial, fue lo unico que me funciono. gracias

malesalazar35 avatar Nov 22 '18 13:11 malesalazar35

@kecondezo, THANK YOU! git config --global url.https://github.com/.insteadOf git://github.com/ solved my error 128. I am running windows10.

h2g2forty2 avatar Nov 26 '18 04:11 h2g2forty2