You can install Yarn through the Homebrew package manager.
This will also install Node.js if it is not already installed.
brew install yarn
If you use nvm or similar, you should ensure that your PATH
lists nvm's shims before the version of Node.js installed by Homebrew.
You can install Yarn through MacPorts.
This will also install Node.js if it is not already installed.
sudo port install yarn
{% include_relative _installations/tarball.md %}
{% include_relative _installations/unix_path_setup.md %}
Yarn will warn you if a new version is available.
To upgrade Yarn, you can do so with Homebrew.
brew upgrade yarn