在更新 Yarn 的版本是時候從官網下載最新的版本時,老是容易下載不了,在看了官方提供在 windows 下用命令行進行下載,所以嘗試了一下,發現很方便好用,現在寫下來方便自己后面有需要查閱。
安裝環境 win10 powershell
使用 Chocolatey 下載安裝 yarn
可以在 powershell 直接執行代碼
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
可以在執行完上面代碼后輸入 choco -? 進行檢查是否安裝完成
安裝完成執行下載最新版本 Yarn
choco install yarn