VSCode中使用Github Copilot,报错 GitHub Copilot could not connect to server. Extension activation failed

2023-11-12

在VSCode中使用Github Copilot ,出现报错 GitHub Copilot could not connect to server. Extension activation failed: “connect ETIMEDOUT xxxx”

问题描述

在VSCode中使用 Github Copilot 编程确实爽,一开始用就停不下来。

不过有时 Copilot 会莫名失效,出现 GitHub Copilot could not connect to server. Extension activation failed: "connect ETIMEDOUT xxxx"的问题,着实令人抓狂。

解决步骤

参考各种资料,发现修改hosts文件即可解决。

具体方法是:
进入C:\Windows\System32\drivers\etc 目录中,以管理员身份打开hosts文件,提示打开方式就使用记事本就行了。再hosts文件中加入:

# vscode copilot config
140.82.112.5 github.com
140.82.112.5 api.github.com

这样一段文字,保存。

重启VSCode,恢复正常。✌✌

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

VSCode中使用Github Copilot,报错 GitHub Copilot could not connect to server. Extension activation failed 的相关文章

随机推荐