VSCode 终端:术语“节点”未被识别为 cmdlet 的名称

Iva*_*kin 1 windows cmd node.js visual-studio-code

问题是我实际上可以通过 Windows CMD 访问 C:\Program Files\nodejs\node.exe,例如:node -v:

C:\Users\User>node -v
v16.13.0
Run Code Online (Sandbox Code Playgroud)

但 Visual Studio Code(已安装 Node.js 扩展包)无法识别终端中的节点。我所能发现的就是:

  1. 我应该将 nodejs 文件夹包含在我的 PATH 变量中(已经完成)并且
  2. 重新启动我的电脑
  3. 重新启动IDE。
  • 所有三个步骤都已完成,但 VSCode 仍然无法识别终端中的“node”命令。
node : The term 'node' 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 
Run Code Online (Sandbox Code Playgroud)

Iva*_*kin 5

现在一切正常,我只需通过 VSCode -> 终端 -> 新终端手动关闭并重新打开终端,同时按终端面板上的“Powershell”按钮也可以解决问题。