我想开始一个新的Angular 项目,但我有以下问题。请指导我。
错误讯息
Error message: ng: File C: \ Users \ installer \ AppData \ Roaming \ npm \ ng.ps1 cannot be loaded.
The file C: \ Users \ installer \ AppData \ Roaming \ npm \ ng.ps1 is not digitally signed.
You cannot run this script on the current system.
For more information about running scripts and setting execution policy,
see about_Execution_Policies at https: /go.microsoft.com/fwlink/? LinkID = 135170.
At line: 1 char: 1 + ng new firstapp + ~~ + CategoryInfo: SecurityError: (:) [],
PSSecurityException + FullyQualifiedErrorId: UnauthorizedAccess.
2条答案
按热度按时间2izufjch1#
我最近开始遇到这个问题,我发现你需要在powershell上运行这个
执行策略有助于保护您免受不信任的脚本的攻击。更改执行策略可能会使您面临https:/www.example.com上about_Execution_Policies帮助主题中描述的安全风险go.microsoft.com/fwlink/?LinkID=135170。是否要更改执行策略?[Y]是[A]全部是[N]否[L]全部否[S]挂起[?]帮助(默认值为“N”):是
然后回答Y
有关👉详细信息,请检查此answer
bsxbgnwa2#
在Powershell终端中运行以下命令。