AppData\Local\Programs\Microsoft' 未被识别为内部或外部命令

AppData\Local\Programs\Microsoft' is not recognized as an internal or external command

我正在使用 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

的新手

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 代码的环境变量路径:

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

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

refreshenv

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