V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
yzql2018
V2EX  ›  GitHub Copilot

copilot 报错 Failed to initiate the GitHub login process 一个可能的解决方法

  •  
  •   yzql2018 · 2022-11-28 13:52:42 +08:00 · 1018 次点击
    这是一个创建于 508 天前的主题,其中的信息可能已经有所发展或是发生改变。

    关于这个问题,有可能是网络连接问题。我的环境是 win7+clash ,这个情况下报错不大可能是网络的问题。我开始也是一头雾水,不知道是哪里的问题,按照网上的方法替换了 copilot 的 core 文件,这个报错倒是没有了,可以授权登录,但是 copilot 提示代码功能仍然不起作用。

    后来忘记看了那篇文章,想到有可能是 copilot-agent-win.exe 进程没有起来的问题,去测试了一下,修复了报错问题,移除了以前替换的文件,恢复了原 core 文件,再登录授权,copilot 代码提示可以正常工作了。检查过程如下:

    到你的插件目录找到 copilot-agent-win.exe 这个文件,然后执行:

    $ ./copilot-agent-win.exe
    Node.js is only supported on Windows 8.1, Windows Server 2012 R2, or higher.
    Setting the NODE_SKIP_PLATFORM_CHECK environment variable to 1 skips this
    check, but Node.js might not execute correctly. Any issues encountered on
    unsupported platforms will not be fixed.
    

    如果显示上面的提示,就说明是 copilot-agent-win.exe 无法正常运行引起的。

    解决办法也很简单,环境变量的系统变量下加一个 NODE_SKIP_PLATFORM_CHECK 变量,值为 1 。然后再次执行

    $ ./copilot-agent-win.exe
    

    如果报错没有了,说明 copilot-agent-win.exe 正常了。

    如果以前替换过插件 core 文件的,还原原来的 core 文件。然后去看 copilot ,登录授权,代码提示应该正常了。

    me221
        1
    me221  
       2022-11-28 14:11:55 +08:00
    Copilot 稳定性比刚出的时候差多了. 我现在经常无缘无故掉登录, 不提示
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1075 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:11 · PVG 07:11 · LAX 16:11 · JFK 19:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.