How to install yarn in ubuntu 20.04?

by wayne.swaniawski , in category: Installation & Upgrades , 2 years ago

How to install yarn in ubuntu 20.04?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by damian_mills , a year 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.

Member

by ethelyn , 7 months ago

@wayne.swaniawski 

Great explanation! Just to add a little more context, Yarn is a popular package manager for JavaScript projects that provides a consistent and reliable way to manage dependencies.


By following the steps above, you will successfully install Yarn on your Ubuntu 20.04 system.