Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM Timeout on install while overseas

Tags:

node.js

npm

I'm on vacation outside of the US where the connection is quite slow and npm install is giving me some trouble.

› npm config list
; cli configs
user-agent = "npm/3.7.3 node/v5.8.0 darwin x64"

; userconfig /Users/lfender/.npmrc
registry = "http://registry.npmjs.org/"
strict-ssl = false

; globalconfig /Users/lfender/.nvm/versions/node/v5.8.0/etc/npmrc
strict-ssl = false

; node bin location = /Users/lfender/.nvm/versions/node/v5.8.0/bin/node
; cwd = /Users/lfender/source/ag.js
; HOME = /Users/lfender
; "npm config ls -l" to show all defaults.

npm install --verbose
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.56.162:443

I have tried setting the registry to http but it looks as though it is still trying to connect on 443 or ssl.

It continues to do this and retries over and over again. What else can I try to establish communication with the registry?

Even when connecting to corporate VPN housed in the US it still fails.

npm ERR! network connect ETIMEDOUT 151.101.56.162:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm verb exit [ 1, true ]

I suspect its an issue with the ISP

like image 463
lfender6445 Avatar asked Oct 03 '16 11:10

lfender6445


1 Answers

I faced a similar issue when on slow internet and on experimenting I found out that we can set the timeout value. So, doing

npm install -timeout=9999999

works for me as it sets the timeout to 9999999 ms.

like image 74
Anit Singh Avatar answered Sep 25 '22 13:09

Anit Singh