我遇到了Windows 10中的Visual Studio代码无法检测集成终端内全局安装的NPM软件包的问题。Visual Studio代码(Windows)未检测到全局NPM模块
例如,如果窗口命令提示我经由命令npm install -g @angular/cli
安装@angular/cli
,该命令提示I内可以执行@角/ CLI命令的如ng --version
没有错误。全球NPM模块安装后,Visual Studio代码中,执行相同的ng --version
给我的错误:
The term 'ng' 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.
我可以然而综合终端内成功执行诸如npm -v
和node -v
命令。
我在我的系统环境变量的下列项目
C:\Program Files\nodejs\
%AppData%\npm
是否有Visual Studio代码用户或系统环境变量我的思念,让全球NPM模块的检测?
感谢您提供任何帮助。
试图将终端从PowerShell中更改为cmd.exe的 –
将默认shell更改为cmd.exe会给我提供有关全局npm模块的相同错误。 –
所以我认为问题是在路径变量..检查他们在全局变量(如果有AppData漫游等npm的路径) –