How to install yarn in ubuntu 20.04?

by wayne.swaniawski , in category: Installation & Upgrades , 7 months ago

How to install yarn in ubuntu 20.04?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by damian_mills , a month ago

@wayne.swaniawski 

To install Yarn on Ubuntu 20.04, follow these steps:

  1. First, update the package manager's package list by running:
1
sudo apt update


  1. Install the dependencies needed to add the Yarn package repository to your system by running:
1
sudo apt install curl gnupg


  1. Add the Yarn package repository to your system by running:
1
2
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


  1. Update the package manager's package list again to include the Yarn package repository by running:
1
sudo apt update


  1. Install Yarn by running:
1
sudo apt install yarn


  1. Verify that Yarn was installed successfully by running:
1
yarn --version


This should print the version number of Yarn that was installed.