【问题标题】:AppData\Local\Programs\Microsoft' is not recognized as an internal or external commandAppData\Local\Programs\Microsoft' 未被识别为内部或外部命令
【发布时间】:2020-12-14 20:33:42
【问题描述】:

我正在使用 GitHub CLI,当我运行 gh gist edit <ID> 时,它给了我这个错误:

 D:\lucas\Documents\Project\fork>gh gist edit 5366f5ac54b02086538313aa8133f660
'D:\lucas\AppData\Local\Programs\Microsoft' is not recognized as an internal or external,
 command, operable program or batch file.
 exit status 1

我不知道是什么问题。请帮忙,我是 GitHub CLI 的新手

【问题讨论】:

    标签: git github command-line-interface


    【解决方案1】:

    gh gist edit 调用gh config editor 然后根据命令在环境变量中找到匹配路径。例如,当您设置gh config set editor "code -w" 时,脚本将根据上述命令在环境变量中查找路径。所以我假设你使用的是 Microsoft VS Code 路径,gh gist edit 实际上是在Microsoft VS Code 中搜索bin 文件夹,这意味着我们有Microsoft VS Code\bin。而且因为它给你\Microsoft'。转到 VS Code 的环境变量路径:

    D:\lucas\AppData\Local\Programs\Code\bin
    

    然后,在您的本地文件夹 D:\lucas\AppData\Local\Programs\Microsoft VS Code 中,将 Microsoft VS Code 更改为 Code。之后,转到您喜欢的终端并运行以下命令:

    refreshenv
    

    刷新后,打开另一个具有管理员权限的终端。并运行gh gist edit。它应该可以工作。

    【讨论】:

    • 它可以工作,但是我为什么要以管理员的权限运行它?
    猜你喜欢
    • 2019-12-04
    • 2014-04-29
    • 1970-01-01
    • 1970-01-01
    • 2013-10-06
    • 2013-10-11
    • 2013-01-25
    • 2016-10-01
    • 2022-01-22
    相关资源
    最近更新 更多