How should yarn be upgraded to the latest version?
yarn
For macOS users, if you installed yarn via brew, you can upgrade it using the below command:
brew
brew upgrade yarn