Error: /c/Users/USER/AppData/Local/atom/bin/../app-1.36.1/resources/cli/atom.sh: line 23: cmd.exe: command not found

Error: /c/Users/USER/AppData/Local/atom/bin/../app-1.36.1/resources/cli/atom.sh: line 23: cmd.exe: command not found

我正在使用 windows 64 位机器并尝试通过 git bash 打开 Atom 编辑器。之前我已经添加了如下环境变量,

然后我在 git bash 中尝试了 $ atom 命令,但出现以下错误,

/c/Users/USER/AppData/Local/atom/bin/../app-1.36.1/resources/cli/atom.sh: line 23: cmd.exe: command not found

拜托,谁能帮我解决这个问题?

PS: Atom 版本为 1.36.1

这由atom/atom issue 17034说明:

It looks like you've modified your $PATH to remove the Microsoft core paths... including the one that specifies where cmd.exe is located.
If you fix that things should start working again.

尝试从 CMD 会话启动 Atom,您可以在其中键入:

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%

set PATH=C:\Users\USER\AppData\Local\atom\bin;%PATH%

(将“USER”替换为您的 Windows 帐户名)

从那里:键入 bash 进入 bash 会话,并检查命令 atom 是否启动 Atom。