简体   繁体   中英

Npm install always return `code ECONNREFUSED` error for all packages

`npm ERR! code ECONNREFUSED
 npm ERR! errno ECONNREFUSED
 npm ERR! FetchError: request to http://registry.npmjs.org/body-parser failed, reason: connect ECONNREFUSED 127.0.0.1:3000`

I tried proxy settings , registry set commands ..But still no use..

Im using node js latest version..and my app listen port is 3000

I tried npm config List ..is there any wrong configuration?

 `; cli configs
 metrics-registry = "https://registry.npmjs.org/"
  scope = ""
 user-agent = "npm/5.3.0 node/v8.1.4 win32 ia32"

; userconfig C:\Users\JANEN\.npmrc
https-proxy = "http://proxy.company.com:8080/"
proxy = "http://proxy.company.com:8080/"
registry = "https://registry.npmjs.org/"

; builtin config undefined
prefix = "C:\\Users\\JANEN\\AppData\\Roaming\\npm"

 ; node bin location = C:\Program Files (x86)\nodejs\node.exe
; cwd = C:\project\authenticationIntro-master
; HOME = C:\Users\JANEN
; "npm config ls -l" to show all defaults.

`

If you're behind a company proxy, the connection is probably refused because the user authentication fails.

Change the proxy address to "http://username:password@proxy.company.com:port"

This should hopefully solve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM