1. Install yarn
npm install -g yarn
![](https://img-blog.csdnimg.cn/img_convert/54104c8350b97823eb05d68c4ca1726d.png)
Check the yarn version to determine whether the installation is successful
>yarn --version
![](https://img-blog.csdnimg.cn/img_convert/4f53ae26556295504ece21b12f23d5ed.png)
2. Yarn download package error: running scripts is prohibited on this system
Error graph:
![](https://img-blog.csdnimg.cn/img_convert/5e5ea22922e765f97477ed3043a319bb.png)
Solution:
Open Windows PowerShell
![](https://img-blog.csdnimg.cn/img_convert/d7dfcf01202da8e9837c39e74c4476f9.png)
View the current PowerShell execution policy type
get-ExecutionPolicy
![](https://img-blog.csdnimg.cn/img_convert/7184de9e85f9df0d1e5d2fe6d497fdc6.png)
Change the PowerShell execution policy type to RemoteSigned
set-ExecutionPolicy RemoteSigned
![](https://img-blog.csdnimg.cn/img_convert/9570455a124e3118b7698e363965b537.png)
View the image source of yarn
yarn config get registry
![](https://img-blog.csdnimg.cn/img_convert/987e8e16362b9f0489d0042e375de3a1.png)
yarn install package
![](https://img-blog.csdnimg.cn/img_convert/0c51d5576bdf5357b47218e3bb419712.png)