yarn was previously provided by cmttest and these are very different programs to yarn the package manager. If you are using software sources (e.g. FarmBot.io) that are managed through yarn (you will find a yarn.lock file with the software source) but when you try and run yarn install and then you get e.g.
yarn install ERROR: [Errno 2] No such file or directory: 'install'
then firstly check to make sure that cmdtest is not installed.
sudo apt remove cmdtest
You would install yarn with
sudo apt-get install yarn
See the yarn packager web site for more details on installation.