当在Node项目中使用yarn出现以下问题的时候:

yarn : File C:\Users\wentu\AppData\Roaming\npm\yarn.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at 
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn install node-sass
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

执行以下命令:

$ Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
最后修改:2023 年 08 月 02 日
如果觉得我的文章对你有用,请随意赞赏