Mac Catalina 上 Visual Studio Code 的集成终端中出现“zsh:未找到命令:ng”

Kyl*_*lla 8 macos zsh visual-studio-code angular macos-catalina

较新的 Mac(Catalina在我的例子中为操作系统)现在有默认的Z Shellaka zsh。使用 Maczsh终端窗口,我已成功进行Angular 11.0.5全局安装并创建了一个项目。我正在使用nvm 0.32.2node 10.23.0

Visual Studio Code但是,在 VS Code 中打开并导航到我的项目时integrated terminal,我使用任何 ng 命令都会收到此错误消息,例如尝试生成组件:

zsh: command not found: ng

有谁知道如何正确设置 Visual Studio Codeintegrated terminal以正确识别 ng 命令zsh

我在这里找到了一种可能的解决方法/sf/answers/4100887661/,但它使用了第三方工具,我希望尽可能避免使用第三方工具。没有其他已知的方法来解决这个问题吗?

Nor*_*ldt 6

这是对我有用的设置

  "terminal.integrated.defaultProfile.osx": "zsh",
  "terminal.integrated.profiles.osx": {
    "tmux": {
      "icon": "terminal-tmux",
      "path": "tmux"
    },
    "zsh": {
      "path": "/bin/zsh"
    }
  },
Run Code Online (Sandbox Code Playgroud)


小智 4

    \n
  • 从菜单导航至:设置 -> 功能 -> 终端

    \n
  • \n
  • 单击“在settings.json\xe2\x80\x9d中编辑”

    \n
  • \n
  • 将此行(键值)添加到对象中:

    \n
    "terminal.integrated.shell.osx": "/bin/zsh"\n
    Run Code Online (Sandbox Code Playgroud)\n
  • \n
  • 关闭并重新启动 Visual Code。

    \n
  • \n
\n