yarn: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/yarn - from package: cmdtest

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/yarn - from package: cmdtest

You may install the required package with command apt-get install {package}
Error in other languages:
yarn: bevel nie gevind nie
yarn: comandă negăsită
yarn: comando não encontrado
yarn: commande introuvable
yarn: command not found
yarn: käsku ei ole
yarn: không tìm thấy lệnh
yarn: komanda nerasta
yarn: Kommando nicht gefunden.
yarn: kommandot finns inte
yarn: komut yok
yarn: nie znaleziono polecenia
yarn: níor aimsíodh an t-ordú
yarn: no se encontró la orden
yarn: no s'ha trobat l'ordre
yarn: opdracht niet gevonden
yarn: parancs nem található
yarn: perintah tidak ditemukan
yarn: príkaz nenájdený
yarn: příkaz nenalezen
yarn: команда не найдена
yarn: командата не е открита
yarn: 命令找不到
yarn: コマンドが見つかりません