我看到有很多关于ng不被计算机识别的问题,但我的问题并不完全是这样。
每个具有命令外壳的软件都可以识别ng,只有vs代码不能。
智能?检查。
哎呀?检查。
窗口命令提示符?检查。
VS 代码?不。
使用 npm run ng 可以工作,但这非常烦人,而不是它应该如何工作。
作为参考,ng 已经在我的道路上,现在看起来像这样:
C:UsersusernameAppDataRoamingnpmnode_modules@angularclibinng
除了 VS 代码之外,它在任何地方都可以工作的任何原因?
找出问题所在:我在VS Code中使用powershell而不是使用CMD。
编辑:另外,要在powershell中使用它,我需要使用命令"设置执行策略不受限制">
我遇到了这个问题,我的VS代码终端没有运行ng命令。 我的终端没有运行 ng 服务。
我从"C:\Users\PC\AppData\Roamingpm"中删除了文件"ng.ps1">
ng.ps1 文件在 "C:\Users\PC\AppData\Roamingpm" 中。
现在,我的VS代码终端运行ng命令。 我的终端运行 ng 服务。
附言 我在 tsc(打字脚本(上遇到了同样的问题,当我删除 tsc.ps1 时,我的终端开始运行 tsc 命令。
1- Press Ctrl+Shift+P to show all commands.
2- Type shell in the displayed text box to filter the list.
3- Select Terminal: Select Default Shell.
4- You will be prompted to Select your preferred terminal shell, you can change this
later in your settings or follow the same process as we do now
5- Select Command Prompt (cmd.exe)
6- Click the Delete Icon in the shell pane to remove the existing terminal.
7- Press Ctrl +back tick(which is the character before the number one in your keyboard)
(or View > Terminal in menu) to open a new terminal pane