当前位置:网站首页>Yarn: the file yarn.ps1 cannot be loaded because running scripts is prohibited on this system.

Yarn: the file yarn.ps1 cannot be loaded because running scripts is prohibited on this system.

2022-07-25 14:54:00 Senior fishing Engineer

yarn : Unable to load file D:\devtool\node\node_global\yarn.ps1, Because scripts are not allowed to run on this system . For more information , see also https:/go.microsoft.com/fwlink/?LinkID=135170 Medium about_Execut
ion_Policies.

npm install --global yarn

install yarn Hold this mistake when .

There is also such a hint :

For more information , see also https:/go.microsoft.com/fwlink/?LinkID=135170 Medium about_Execut
ion_Policies.

Looked at the , Is probably powershell Security policy issues .
 Insert picture description here

solve

Follow the instructions in the above article , Modify security policy :

  • open powershell, Open as administrator
  • set-ExecutionPolicy RemoteSigned, choice Y
  • get-ExecutionPolicy See if it's RemoteSigned

verification

npm install --global yarn

The successful running ~

原网站

版权声明
本文为[Senior fishing Engineer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/206/202207250915438414.html