npm global install yarn code example Example 1: macos install yarn brew install yarn Example 2: npm install --global yarn npm install --global yarn