重新安装后,Angular CLI无法正常工作。

huangapple go评论84阅读模式
英文:

Angular Cli does nor working after reinstalling it

问题

我想升级我的Angular Cli,通过删除它并安装新版本,现在我无法运行ng命令,总是出现以下错误信息:
ng : 无法加载文件 C:\Users\Sirius\AppData\Roaming\npm\ng.ps1。文件 C:\Users\Sirius\AppData\Roaming\npm\ng.ps1 未经数字签名。您无法在当前系统上运行此脚本。有关运行脚本和设置执行策略的更多信息,请参阅 about_Execution_Policies,网址为 https:/go.microsoft.com/fwlink/?LinkID=135170。
At line:1 char:1

  • ng serve --open
  • ~~
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess

我再次卸载了Angular Cli并重新安装它(但没有成功)。

英文:

I wanted to uprade my Angular Cli by removing it and instaling the new version,
now i cant run ng commands anymore ,there is always this error Message:
ng : File C:\Users\Sirius\AppData\Roaming\npm\ng.ps1 cannot be loaded. The file C:\Users\Sirius\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 serve --open
  • ~~
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess

i uninstalled the angular cli another time and reinstalled it(it doesnt worked out)

答案1

得分: 0

这是一个常见的问题。你可以尝试完全清理你的命令行安装:https://stackoverflow.com/a/58044573/10458514

或者执行一个 PowerShell 命令来授权执行 ng 命令:https://www.thecodebuzz.com/angular-powershell-ng-ps1-can-not-be-loaded-and-not-digitally-signed/

英文:

This is a common, issue. You can either try to fully clean your cli install : https://stackoverflow.com/a/58044573/10458514

Or execute a PS command to authorize the execution of ng command : https://www.thecodebuzz.com/angular-powershell-ng-ps1-can-not-be-loaded-and-not-digitally-signed/

huangapple
  • 本文由 发表于 2023年8月8日 22:57:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76860781.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定