yarn : 无法加载文件 D:\nvm\nodejs\yarn.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?

        这个错误是因为 PowerShell 的执行策略(Execution Policy)阻止了 yarn 脚本的运行。以下是几种解决方法:

方法 1:临时更改执行策略(推荐先尝试)

  1. 以管理员身份打开 PowerShell

  2. 运行以下命令:

powershell

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  1. 然后再次尝试运行 yarn 命令

方法 2:永久更改执行策略(需要管理员权限)

  1. 以管理员身份打开 PowerShell

  2. 运行:

powershell

Set-ExecutionPolicy RemoteSigned -Force

方法 3:使用 cmd 而不是 PowerShell

  1. 打开命令提示符(cmd)而不是 PowerShell

  2. 直接运行你的 yarn 命令

方法 4:使用 yarn.cmd 代替

powershell

yarn.cmd run dev

方法 5:删除 yarn.ps1 文件(如果不需要)

    <

你可能感兴趣的:(Vue3.0,vue.js)