How should yarn
be upgraded to the latest version?
npm install --global yarn
npm upgrade --global yarn
This should work.
npm install -g yarn
- solved the issue when nothing happened running npm update --global yarn
.
Alternative method to update yarn: curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
.
Mac users with homebrew can run brew upgrade yarn
.
More details here and here.
If you already have yarn 1.x
and you want to upgrade to yarn 2. You need to do something a bit different:
yarn set version berry
Where berry is the code name for yarn version 2. See this migration guide here for more info.
For macOS users, if you installed yarn
via brew
, you can upgrade it using the below command:
brew upgrade yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
Please note that the last command will upgrade yarn to latest version if package already installed.
For more info you can check the docs: yarn installation
I updated yarn on my Ubuntu by running the following command from my terminal
curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
source:https://yarnpkg.com/lang/en/docs/cli/self-update