问题描述
较新的 Mac(在我的情况下为 Catalina
操作系统)现在具有默认的 Z Shell
aka zsh
.使用 Mac zsh
终端窗口,我已经成功地全局安装了 Angular 11.0.5
并创建了一个项目.我正在使用 nvm 0.32.2
和 node 10.23.0
.
Newer Macs (Catalina
OS in my case) now have the default Z Shell
aka zsh
. Using a Mac zsh
terminal window, I've successfully installed Angular 11.0.5
globally and created a project. I'm using nvm 0.32.2
and node 10.23.0
.
但是,在打开 Visual Studio Code
并在 VS Code 的 integrated terminal
中导航到我的项目时,我使用任何 ng 命令收到此错误消息,例如尝试生成一个组件:
However, on opening Visual Studio Code
and navigating to my project within VS Code's integrated terminal
, I get this error message using any ng command, such as trying to generate a component:
zsh:找不到命令:ng
有谁知道如何正确设置 Visual Studio Code 的 integrated terminal
以使用 zsh
正确识别 ng 命令?
Does anyone know how to properly set up Visual Studio Code's integrated terminal
to properly identify ng commands using zsh
?
我在这里找到了一种可能的解决方法https://stackoverflow.com/a/58584109/6647188 但它使用第三方工具,如果可能,我想避免使用这些工具.有没有其他已知的方法可以解决这个问题?
I've found one possible work around here https://stackoverflow.com/a/58584109/6647188 but it uses third party tools which I'd like to avoid if possible. Is there no other known way to resolve this?
推荐答案
镶边 ->特点 - >终端
Sertings -> Features -> Terminal
点击在 settings.json 中编辑"
Click in "Edit in settings.json"
将此行(键值)添加到对象中:
Add this line(key value) to the object:
"terminal.integrated.shell.osx": "/bin/zsh"
关闭并重新启动 Visual Code.
Close and relaunch Visual Code.
这篇关于Mac Catalina 上 Visual Studio Code 的集成终端中的“zsh: command not found: ng"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!