npm install yarn globally code example Example 1: install yarn npm install -g yarn Example 2: bash: yarn: command not found brew install yarn