1. If mac has not installed homeBrew, run this command first
/usr/bin/ruby -e "$(curl -fsSL http://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
After installation, close the window and reopen it to check the version yarn --version to check whether the installation is successful
2. Those who have installed homeBrew can install it directly through homeBrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
npm install --global yarn
yarn --version
After installation, you can create a new folder, right-click to open the black window, yarn init and enter to the end, and then install the Taobao mirror:
yarn config set registry https://registry.npm.taobao.org
3. Install directly with script
curl -o- -L https://yarnpkg.com/install.sh | bash
yarn bothered me for two days. Baidu tried again and again for a long time and finally it worked
Here are some other things about yarn that I found
Use brew to remove yarn
brew uninstall --force yarn
npm r -g yarn
query the location of yarn
which yarn
/usr/local/bin/yarn
use rm to remove yarn and yarn