ng : 无法加载文件 C:\Users\xxxxx\AppData\Roaming\npm\ng.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go
.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ ng -v
+ ~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
解决办法:一定要以管理员身份运行powershell。
然后输入命令:
set-ExecutionPolicy RemoteSigned命令,然后选择A即可
然后就能在vscode中正常使用ng命令了。
本文非常感谢: ng : 无法加载文件 C:\Users\AppData\Roaming\npm\ng.ps1_sjslln的博客-CSDN博客