PS E:\AntDesignPro\umiapp> yarnyarn : 无法加载文件 E:\Nodejs\node_global\yarn.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参

报错内容:

PS E:\AntDesignPro\umiapp> yarn
yarn : 无法加载文件 E:\Nodejs\node_global\yarn.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。      
所在位置 行:1 字符: 1
+ yarn
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

报错解决:

cmd打开PowerShell从普通模式转至管理员模式,

输入以下PowerShell命令然后按下回车键。

Start-Process powershell -Verb runAs 

 在新打开的PowerShell窗口 先输入 get-ExecutionPolicy

查看状态

此处为: Restrict  受限

 再输入set-ExecutionPolicy RemoteSigned

重新运行yarn install成功

 

猜你喜欢

转载自blog.csdn.net/qq_40421671/article/details/130482047