0

目前我正与Visual Studio代码和Erlang的问题,我有我的电脑上安装二郎/ OTP,我已经安装了Visual Studio代码Erlang的插件,但是我无法从内部终端窗口运行erlang。当我尝试我收到此错误:二郎不与Visual Studio代码终端内工作

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 

任何帮助,将不胜感激。

+0

*我已经安装了二郎山插件* - 您可以缩小下来一点? – 7stud

+0

你能否在我的答案底部添加评论来描述你的工作方式?这将帮助其他人。 – 7stud

回答

3

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之后测试它是否正常工作?

+1

对不起,我一直在忙,我固定它在我的设置中添加这样的:' “terminal.integrated.shell.windows”: “C:\\ Program Files文件\\ \\ erl8.2斌\\ erl.exe” “terminal.integrated.cwd”:“A:\\ \\文件夹\\二郎”'我也安装了不同版本的Erlang,我是有从官方网站的版本问题,但是如果从二郎下载它的工作原理,不知道为什么 –