提供服务时出现CLI错误

问题描述 投票:0回答:2

ng:无法加载文件C:\ Users \ Lenovo \ AppData \ Roaming \ npm \ ng.ps1。文件C:\ Users \ Lenovo \ AppData \ Roaming \ npm \ ng.ps1没有经过数字签名。你不能跑当前系统上的此脚本。有关运行脚本和设置执行策略的更多信息,请参见about_Execution_Policies,网址为https://go.microsoft.com/fwlink/?LinkID=135170。在第1行:char:1+ ng服务+ ~~+ CategoryInfo:SecurityError:(:) [],PSSecurityException+ FullyQualifiedErrorId:UnauthorizedAccess

同时提供ng服务显示此错误。如何克服它?

angular
2个回答
0
投票

您在哪里运行此脚本。 ng serve只能在Angular项目中运行...


0
投票

从目录C:\ Users \ \ AppData \ Roaming \ npm \中删除ng.ps1,然后尝试清除C:\ Users \ \ AppData \ Roaming \ npm-cache \]中的npm缓存

对我来说,这行得通,只是有同样的问题。

此修补程序的作者来自THIS帖子。

© www.soinside.com 2019 - 2024. All rights reserved.