yarn command not found

In this troubleshooting guide we learn how to fix yarn command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

yarn: command not found

or when using sudo you get the following error message

sudo: yarn: command not found

Solutions to yarn: command not found

How To Fix yarn: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu yarn is provided by cmdtest package.

cmdtest is:

cmdtest black box tests Unix command line tools. Roughly, it is given a script, its input files, and its expected output files. cmdtest runs the script, and checks the output is as expected.

cmdtest is aimed specifically at testing non-interactive Unix command line programs, and tries to make that as easy as possible.

Also included is a “scenario testing” tool, yarn.

To fix this problem, we can install more using the command below.

sudo apt-get -y install cmdtest

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install cmdtest.

sudo apt -y install cmdtest

Or if you have aptitude installed you can use the following command.

sudo aptitude install cmdtest

Summary

In this tutorial we learn how to fix yarn command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.