Install yarn using npm
Use following to check whether yarn cli command is installed or not and also check its version
$ yarn --version 1.22.4
You can use npm to upgrade already installed yarn to the latest version or install it if it is not installed
$ npm install -g yarn /Users/<home-dir>/.nvm/versions/node/v12.11.1/bin/yarn -> /Users/<home-dir>/.nvm/versions/node/v12.11.1/lib/node_modules/yarn/bin/yarn.js /Users/<home-dir>/.nvm/versions/node/v12.11.1/bin/yarnpkg -> /Users/<home-dir>/.nvm/versions/node/v12.11.1/lib/node_modules/yarn/bin/yarn.js yarn@1.22.4 updated 1 package in 0.426s