5

I receive this error when installing any npm:

30 error Windows_NT 6.1.7601
31 error argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "npm" "-g"
32 error node v0.12.7
33 error npm v2.11.3
34 error code ECONNREFUSED
35 error errno ECONNREFUSED
36 error syscall connect
37 error Error: connect ECONNREFUSED at exports._errnoException (util.js:746:11) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
37 error { [Error: connect ECONNREFUSED]
37 error code: 'ECONNREFUSED',
37 error errno: 'ECONNREFUSED',
37 error syscall: 'connect' }
38 error If you are behind a proxy, please make sure that the
38 error 'proxy' config is set properly. See: 'npm help config'
39 verbose exit [ 1, true ]

Can you give me any help?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user3144678
  • 111
  • 9
  • And are you behind a proxy? (If not, are you sure? Have you checked with your network administrator?) – Quentin May 11 '16 at 11:07
  • 1
    Yes? So did you check that the proxy config was set correctly? Did you read npm help config? – Quentin May 15 '16 at 10:43
  • it's first time im doing it so may be there is a problem in the configuration any way this is form .npmrc file proxy=http://domainname:8080 htps-proxy=http://domainname:8080 https-proxy=http://domainname:8080 – user3144678 May 16 '16 at 13:23
  • Possible duplicate of [npm ERR! Error: connect ECONNREFUSED](https://stackoverflow.com/questions/42371380/npm-err-error-connect-econnrefused) – Piqué Sep 22 '17 at 14:58

2 Answers2

2

You should set proxy for npm config first. Please refer to the article below. Hope it will help.

https://jjasonclark.com/how-to-setup-node-behind-web-proxy

Abdul Moiz Khan
  • 693
  • 5
  • 13
1
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

Set the proxies like above and it will work fine

mention your organisation name in company or your organisation's proxy address with port