[英]yo version check fails while behind proxy
I am trying to setup my SharePoint framework environment and Yeoman is required.我正在尝试设置我的 SharePoint 框架环境,并且需要 Yeoman。 My PC (Win10 home edition) is sitting behind company proxy server and I have setup related config (I setup both http-proxy and http_proxy because I don't know which one is right)我的电脑(Win10 家庭版)在公司代理服务器后面,我已经设置了相关配置(我设置了 http-proxy 和 http_proxy,因为我不知道哪个是正确的)
C:\Windows\system32>npm config ls -l |findstr prox
http-proxy = "http://proxy2:8080"
http_proxy = "http://proxy2:8080"
https-proxy = "http://proxy2:8080/"
https_proxy = "http://proxy2:8080"
proxy = "http://proxy2:8080/"
; https-proxy = null (overridden)
noproxy = null
; proxy = null (overridden)
However it is still fail for version check:但是版本检查仍然失败:
C:\Windows\system32>npx yo doctor
.......
× yo version
{ RequestError: connect ECONNREFUSED 104.16.21.35:443
at ClientRequest.req.once.err (C:\Users\mpllui\AppData\Roaming\npm\node_modules\yo\node_modules\latest-version\node_modules\got\index.js:73:21)
at Object.onceWrapper (events.js:286:20)
at ClientRequest.emit (events.js:198:13)
at TLSSocket.socketErrorListener (_http_client.js:392:9)
at TLSSocket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
code: 'ECONNREFUSED',
message: 'connect ECONNREFUSED 104.16.21.35:443',
host: 'registry.npmjs.org',
hostname: 'registry.npmjs.org',
method: 'GET',
path: '/yo' }
√ npm version
I tried to understand the issue discussion here ( https://github.com/yeoman/yo/issues/589 ).我试图理解这里的问题讨论( https://github.com/yeoman/yo/issues/589 )。 It looks like the bug is fixed in 2018 already.看起来这个错误已经在 2018 年修复了。 I checked my yo version is latest:我检查了我的 yo 版本是最新的:
C:\Windows\system32>yo --version
3.1.0
How can I solve it?我该如何解决? Or indeed version check is not important because I have latest version already?或者确实版本检查并不重要,因为我已经有了最新版本?
HAve a look at this issue.看看这个问题。 https://github.com/yeoman/yo/issues/589 https://github.com/yeoman/yo/issues/589
Looks like Yo is using variable GLOBAL_AGENT_HTTP_PROXY.看起来 Yo 正在使用变量 GLOBAL_AGENT_HTTP_PROXY。 (The very last comment) (最后一条评论)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.