This example explains the different methods to install Yarn for your OS.
brew update
brew install yarn
sudo port install yarn
Add the following to your preferred shell profile (.profile
, .bashrc
, .zshrc
etc)
export PATH="$PATH:`yarn global bin`"
First, install Node.js if it is not already installed.
Download the Yarn installer as an .msi
from the Yarn website.
choco install yarn
Ensure Node.js is installed for your distro, or run the following
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Configure the YarnPkg repository
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
Install Yarn
sudo apt-get update && sudo apt-get install yarn
Install Node.js if not already installed
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
Install Yarn
sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
sudo yum install yarn
Install Yarn via AUR.
Example using yaourt:
yaourt -S yarn
sudo eopkg install yarn
Add the following to your preferred shell profile (.profile
, .bashrc
, .zshrc
etc)
export PATH="$PATH:`yarn global bin`"
curl -o- -L https://yarnpkg.com/install.sh | bash
or specify a version to install
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version [version]
cd /opt
wget https://yarnpkg.com/latest.tar.gz
tar zvxf latest.tar.gz
If you already have npm installed, simply run
npm install -g yarn
Check the installed version of Yarn by running
yarn --version