yarn install error: yarn: cannot load the file C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1 because running scripts is prohibited on this system.

1. Install yarn

npm install -g yarn

Check the yarn version to determine whether the installation is successful

>yarn --version

2. Yarn download package error: running scripts is prohibited on this system

Error graph:

Solution:

  1. Open Windows PowerShell

  1. View the current PowerShell execution policy type

get-ExecutionPolicy
  1. Change the PowerShell execution policy type to RemoteSigned

set-ExecutionPolicy RemoteSigned
  1. View the image source of yarn

yarn config get registry
  1. yarn install package

Guess you like

Origin blog.csdn.net/weixin_45371730/article/details/128907214