Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing any npm

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?

like image 436
user3144678 Avatar asked Oct 18 '22 09:10

user3144678


2 Answers

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

like image 130
Abdul Moiz Khan Avatar answered Oct 30 '22 23:10

Abdul Moiz Khan


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

like image 45
Rajesh Kumaresan Avatar answered Oct 30 '22 22:10

Rajesh Kumaresan