1、at process._tickCallback (internal/process/next_tick.js:188:7) npm ERR! message: 'request to https://registry.npm.taobao.org/vue-cli failed, reason: connect ECONNREFUSED 127.0.0.1:1080',
1)报错信息大概如下:
1 E:WebStormFilelabSystem>npm i -g vue-cli 2 npm ERR! code ECONNREFUSED 3 npm ERR! errno ECONNREFUSED 4 npm ERR! FetchError: request to https://registry.npm.taobao.org/vue-cli failed, reason: 5 connect ECONNREFUSED 127.0.0.1:1080 6 npm ERR! at ClientRequest.req.on.err (E:ProgramFiles odejs ode_modules pm ode_ 7 modulespacote ode_modulesmake-fetch-happen ode_modules ode-fetch-npmsrcindex.js: 8 68:14) 9 npm ERR! at emitOne (events.js:116:13) 10 npm ERR! at ClientRequest.emit (events.js:211:7) 11 npm ERR! at onerror (E:ProgramFiles odejs ode_modules pm ode_modulespacote o 12 de_modulesmake-fetch-happen ode_moduleshttps-proxy-agent ode_modulesagent-baseind 13 ex.js:106:9) 14 npm ERR! at callbackError (E:ProgramFiles odejs ode_modules pm ode_modulespac 15 ote ode_modulesmake-fetch-happen ode_moduleshttps-proxy-agent ode_modulesagent-ba 16 seindex.js:126:5) 17 npm ERR! at <anonymous> 18 npm ERR! at process._tickCallback (internal/process/next_tick.js:188:7) 19 npm ERR! { FetchError: request to https://registry.npm.taobao.org/vue-cli failed, reas 20 on: connect ECONNREFUSED 127.0.0.1:1080 21 npm ERR! at ClientRequest.req.on.err (E:ProgramFiles odejs ode_modules pm ode_ 22 modulespacote ode_modulesmake-fetch-happen ode_modules ode-fetch-npmsrcindex.js: 23 68:14) 24 npm ERR! at emitOne (events.js:116:13) 25 npm ERR! at ClientRequest.emit (events.js:211:7) 26 npm ERR! at onerror (E:ProgramFiles odejs ode_modules pm ode_modulespacote o 27 de_modulesmake-fetch-happen ode_moduleshttps-proxy-agent ode_modulesagent-baseind 28 ex.js:106:9) 29 npm ERR! at callbackError (E:ProgramFiles odejs ode_modules pm ode_modulespac 30 ote ode_modulesmake-fetch-happen ode_moduleshttps-proxy-agent ode_modulesagent-ba 31 seindex.js:126:5) 32 npm ERR! at <anonymous> 33 npm ERR! at process._tickCallback (internal/process/next_tick.js:188:7) 34 npm ERR! message: 'request to https://registry.npm.taobao.org/vue-cli failed, reason: 35 connect ECONNREFUSED 127.0.0.1:1080', 36 npm ERR! type: 'system', 37 npm ERR! errno: 'ECONNREFUSED', 38 npm ERR! code: 'ECONNREFUSED', 39 npm ERR! stack: 'FetchError: request to https://registry.npm.taobao.org/vue-cli faile 40 d, reason: connect ECONNREFUSED 127.0.0.1:1080 at ClientRequest.req.on.err (E:\Pr 41 ogramFiles\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-h 42 appen\node_modules\node-fetch-npm\src\index.js:68:14) at emitOne (events.js:11 43 6:13) at ClientRequest.emit (events.js:211:7) at onerror (E:\ProgramFiles\n 44 odejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_m 45 odules\https-proxy-agent\node_modules\agent-base\index.js:106:9) at callbackEr 46 ror (E:\ProgramFiles\nodejs\node_modules\npm\node_modules\pacote\node_modules\m 47 ake-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:1 48 26:5) at <anonymous> at process._tickCallback (internal/process/next_tick.js: 49 188:7)' } 50 npm ERR! 51 npm ERR! If you are behind a proxy, please make sure that the 52 npm ERR! 'proxy' config is set properly. See: 'npm help config' 53 54 npm ERR! A complete log of this run can be found in: 55 npm ERR! E:ProgramFiles odejs ode_cache\_logs2019-11-20T07_33_07_386Z-debug.log
2)原因:npm配置了代理(可以使用" npm config list -l "命令查看npm配置)
1 E:WebStormFilelabSystem>npm config list -l 2 ; cli configs 3 long = true 4 metrics-registry = "https://registry.npm.taobao.org/" 5 scope = "" 6 user-agent = "npm/5.6.0 node/v8.11.3 win32 x64" 7 8 ; userconfig C:Users25392.npmrc 9 cache = "E:\ProgramFiles\nodejs\node_cache" 10 cacheE:ProgramFiles odejs ode_cache = "" 11 home = "https://www.npmjs.org" 12 https-proxy = "http://127.0.0.1:1080/" 13 prefix = "E:\ProgramFiles\nodejs\node_global" 14 prefixE:ProgramFiles odejs ode_cache = "" 15 prefixE:ProgramFiles odejs ode_global = "" 16 proxy = null 17 registry = "https://registry.npm.taobao.org/" 18 19 ; default values 20 access = null 21 allow-same-version = false 22 also = null 23 always-auth = false 24 auth-type = "legacy" 25 bin-links = true 26 browser = null 27 ca = null 28 ; cache = "C:\Users\25392\AppData\Roaming\npm-cache" (overridden) 29 cache-lock-retries = 10 30 cache-lock-stale = 60000 31 cache-lock-wait = 10000 32 cache-max = null 33 cache-min = 10 34 cafile = undefined 35 cert = null 36 cidr = null 37 color = true 38 commit-hooks = true 39 depth = null 40 description = true 41 dev = false 42 dry-run = false 43 editor = "notepad.exe" 44 engine-strict = false 45 fetch-retries = 2 46 fetch-retry-factor = 10 47 fetch-retry-maxtimeout = 60000 48 fetch-retry-mintimeout = 10000 49 force = false 50 git = "git" 51 git-tag-version = true 52 global = false 53 global-style = false 54 globalconfig = "E:\ProgramFiles\nodejs\node_global\etc\npmrc" 55 globalignorefile = "E:\ProgramFiles\nodejs\node_global\etc\npmignore" 56 group = 0 57 ham-it-up = false 58 heading = "npm" 59 ; https-proxy = null (overridden) 60 if-present = false 61 ignore-prepublish = false 62 ignore-scripts = false 63 init-author-email = "" 64 init-author-name = "" 65 init-author-url = "" 66 init-license = "ISC" 67 init-module = "C:\Users\25392\.npm-init.js" 68 init-version = "1.0.0" 69 json = false 70 key = null 71 legacy-bundling = false 72 link = false 73 local-address = undefined 74 loglevel = "notice" 75 logs-max = 10 76 ; long = false (overridden) 77 maxsockets = 50 78 message = "%s" 79 ; metrics-registry = null (overridden) 80 node-options = null 81 node-version = "8.11.3" 82 offline = false 83 onload-script = null 84 only = null 85 optional = true 86 otp = 0 87 package-lock = true 88 package-lock-only = false 89 parseable = false 90 prefer-offline = false 91 prefer-online = false 92 ; prefix = "E:\ProgramFiles\nodejs" (overridden) 93 production = false 94 progress = true 95 proxy = null 96 read-only = false 97 rebuild-bundle = true 98 ; registry = "https://registry.npmjs.org/" (overridden) 99 rollback = true 100 save = true 101 save-bundle = false 102 save-dev = false 103 save-exact = false 104 save-optional = false 105 save-prefix = "^" 106 save-prod = false 107 scope = "" 108 script-shell = null 109 scripts-prepend-node-path = "warn-only" 110 searchexclude = null 111 searchlimit = 20 112 searchopts = "" 113 searchstaleness = 900
3)使用" npm config delete https-proxy "命令删除配置 (https-proxy = "http://127.0.0.1:1080/")就可以正常下载啦
2、