Erlang 无法在 Visual Studio 代码中使用内部终端

Erlang not working with internal Terminal in Visual Studio Code

我目前遇到 visual studio 代码和 erlang 的问题,我在我的 PC 上安装了 erlang/OTP,并且我已经为 visual studio 代码安装了 erlang 插件,但是我不能从内部终端 运行 erlang window。当我尝试收到此错误时:

erl : The term 'erl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ erl
+ ~~~
+ CategoryInfo          : ObjectNotFound: (erl:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

如有任何帮助,我们将不胜感激。

尝试以下指南并安装 erlang

https://www.rose-hulman.edu/Users/faculty/young/CS-Classes/resources/Erlang/index.html

来自VS docs

The shell [that is] used [by VS] defaults to $SHELL on Linux and OS X, and %COMSPEC% on Windows. These can be overridden manually by setting terminal.integrated.shell.* in settings.

所以我会检查您的 %COMSPEC% 环境变量的值是多少。或者,您可以在 VS 设置中覆盖 %COMSPEC%

来自VS docs

Correctly configuring your shell on Windows is a matter of locating the right executable. VS Code defaults to the %COMSPEC% environment variable on Windows which typically points to the 32-bit version of cmd.exe.

Below are a list of common shell executables and their default locations:

// 64-bit cmd if available, otherwise 32-bit
"terminal.integrated.shell.windows": "C:\Windows\sysnative\cmd.exe"
// 64-bit PowerShell if available, otherwise 32-bit
"terminal.integrated.shell.windows": "C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe"
// Git Bash
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"
// Bash on Ubuntu (on Windows)
"terminal.integrated.shell.windows": "C:\Windows\sysnative\bash.exe"

您可能还想检查 erlang 的路径是否在您的 %PATH% 环境变量中,如果不在,则添加它。你之前有没有成功启动过 erlang shell,例如安装 erlang 以测试它是否正常工作后?