How do I change the version of yarn used?

davidhu picture davidhu · Jun 9, 2017 · Viewed 84.7k times · Source

I used Homebrew to install yarn. Running yarn -v shows that I currently use 0.23.2. I ran brew upgrade yarn to get the latest version, which is 0.24.6.

After Homebrew successfully upgrades yarn, I run yarn -v again, but the version is still 0.23.2. How can I change the version of `yarn that I am running?

Answer

Christian Rauh picture Christian Rauh · May 16, 2019
yarn policies set-version <version number>

Per https://github.com/yarnpkg/yarn/issues/7146#issuecomment-477809216