Sal-laS
Sal-laS

Reputation: 11639

Error code 0:npm install -g phonegap

I tried npm install -g phonegap and and after few seconds i will find this error and warning enter image description here.

and after few minutes again Socket hang up enter image description here

And in the end it is not installed enter image description here

I should mention i tried this

npm config set registry http://registry.npmjs.org/

and even

  npm config set registry https://github.com/ariya/esprima/tarball/master

,but non of them worked.

Upvotes: 2

Views: 792

Answers (1)

damphat
damphat

Reputation: 18956

If you can download https://github.com/ariya/esprima/tarball/master from your browser, that means your network is ok.

I think the problem is because the github server delay the response to prevent DDos attack.

You can change the following default values:

fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000

example:

npm config set fetch-retries 4
npm config set fetch-retry-maxtimeout 120000
npm config set fetch-retry-mintimeout 60000

Upvotes: 1

Related Questions