Installing Yarn and Git on AWS EC2

Divyanshu Agarwal
2 min readMar 13, 2021

was initiated by Facebook, and is now supported by major companies like Google. It’s a replacement for package management in js projects, with quite a few features missing from the npm CLI.

1. Installing Yarn via script

Run the following command

curl -o- -L https://yarnpkg.com/install.sh | bash

Reload the bash profile

source ~/.bashrc

2. Installing Yarn via YUM

Yarn packages are also available with yum package manager. You can configure yarn official yum repository using the below command:

curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo

Once you have executed above command run

sudo yum install yarn

3. Installing yarn via NPM

sudo npm install yarn -g

4. Verify Yarn

Run the following command to verify the installation

yarn -v

Expected Output:

1.22.5

Install Git

is the most commonly used version control system. It tracks the changes we make to then files, so we have a record of what has been done, and can revert to specific versions should we ever need to.

1. Update YUM

sudo yum update -y

2. Install Git

sudo yum install git -y

3. Check if git is installed properly

git version

Expected output

git version 2.23.3

--

--