0

I was trying to run node with the angular.js tutorial application and I found that npm isntall was not behaving itself.

I got a strange little spinning character that seemed to never stop.

I ran npm install -verbose and got the following debug trace:

216 error network tunneling socket could not be established, cause=connect ETIMEDOUT
216 error network This is most likely not a problem with npm itself
216 error network and is related to network connectivity.
216 error network In most cases you are behind a proxy or have bad network settings.
216 error network
216 error network If you are behind a proxy, please make sure that the
216 error network 'proxy' config is set properly.  See: 'npm help config'

SO I've identified a problem. I've no idea how to go about fixing it. What do?

Salem
  • 12,808
  • 4
  • 34
  • 54
Drew L. Facchiano
  • 283
  • 3
  • 5
  • 12

4 Answers4

5

Must configure the proxy you are using, in npm.

npm config set proxy http://<proxy-url>:<port>
npm config set https-proxy http://<proxy-url>:<port>

If you don't know proxy url, could get it by registry, in cmd run:

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | find /i "proxyserver"

Hope it helps, I faced the same error.

MarioAraya
  • 336
  • 5
  • 10
1

I had a similar problem once and i solved it by :-

npm config set proxy


npm config set registry "http://registry.npmjs.org/"
Rishabh Jain
  • 526
  • 1
  • 10
  • 26
  • If you are behind proxy, set the proxy in npm config file(C:\Users\{user_name}\.npmrc). See answer from @MarioAraya. Make sure that your proxy is not blocking npm registry url(cmd>ping registry.npmjs.org) – sree Nov 03 '16 at 05:44
  • @rishabh-jain thanks that's really helped me. – Sheikhah Maasher Jun 08 '21 at 05:00
1

I am also facing the same error of Proxy settings, first i found this was happening for default browsers settings problems.

npm config set rm proxy http.
npm config set rm https-proxy http.

Then Uninstall your Chrome browser and npm. Make default browser in Edge, then install npm and try the React-cli command.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
0
npm config set registry "http://registry.npmjs.org/"

Then, simply install all the node modules by using npm i command

Tyler2P
  • 2,324
  • 26
  • 22
  • 31