【问题标题】:Trying to create my first project in angular尝试以角度创建我的第一个项目
【发布时间】:2021-08-20 11:43:45
【问题描述】:

我正在运行 ng 新名称并发生错误。你知道为什么会这样吗?

ng : 文件 C:\Users\nraftis\​​AppData\Roaming\npm\ng.ps1 无法加载,因为在此系统上禁用了运行脚本。有关详细信息,请参阅 https://go.microsoft.com/fwlink/?LinkID=135170 上的 about_Execution_Policies。 在 line:1 char:1

  • ng 新的网格列表
  • ~~
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess

【问题讨论】:

  • 你的机器有管理员权限吗?
  • windows... 如果你想成为一名优秀的开发人员 - 尝试使用 linux/macos。启动任何应用程序更简单
  • 按照错误消息中提供给您的链接进行操作(如果它导致 404,只需 google Execution Policies powershell,默认情况下,powershell 中的脚本执行是禁用的,您只需要启用它。您将在 Microsoft 的网站上找到所有信息以及这样做的影响

标签: angular


【解决方案1】:

好的,我找到了解决方案。

  1. 以管理员身份运行 Powershell
  2. 运行“Set-ExecutionPolicy -Scope CurrentUser””
  3. 设置 ExecutionPolicy:无限制

完成了!

enter image description here

【讨论】:

    猜你喜欢
    • 2022-01-22
    • 1970-01-01
    • 2023-03-04
    • 2019-02-12
    • 2020-04-08
    • 1970-01-01
    • 2023-03-10
    • 1970-01-01
    • 2014-07-14
    相关资源
    最近更新 更多