搭建vue项目报错

559 阅读1分钟

vue : 无法加载文件 C:\Users\EDZ\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_P olicies。 所在位置 行:1 字符: 1

  • vue -V
  •   + CategoryInfo          : SecurityError: (:) [],PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess
      + 
    


1. 以管理员身份运行PowerShell
2. 执行:get-ExecutionPolicy,回复Restricted,表示状态是禁止的
3.执行:set-ExecutionPolicy RemoteSigned
4.选择Y
注意:一定要以管理员的身份运行PowerShell,不是cmd窗口!