iVampireSP 的物语

与所有美好的存在又多了一年的物语

Windows11 上 PowerShell 执行 yarn 遇到的决策问题

报错:

yarn : File C:\Users\ivamp\AppData\Roaming\npm\yarn.ps1 cannot be loaded because running scripts is disabled on this sy
stem. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn config set registry https://registry.npm.taobao.org/
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

解决方法

  1. 使用管理员权限打开 PowerShell
  2. 执行 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

问题解决。

2 条回复

  1. 阿小州 的头像
    阿小州

    好粉嫩的博客

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注