How to Install Yarn on Ubuntu 18.04

Yarn is a JavaScript package manager compatible with npm that helps you automate the process of installing, updating, configuring, and removing npm packages.

It was created to solve a set of problems with the npm such as speeding up the packages installation process by parallelizing operations and reducing errors related to network connectivity.

OPTIONAL. Windows 10 Users

To install ubunu 18.04 on Windows 10 WSL, follow instructions below:

How To Install WSL on Windows 10

STEP 1. Enable yarn repository

curl -sS | sudo apt-key add -

echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

STEP 2. Install

sudo apt update

#If you don't have node installed
sudo apt install yarn 

#If you have node installed
sudo apt install --no-install-recommends yarn

Step 3. Verify

yarn --version