install yarn on npm code example Example 1: install yarn npm install -g yarn Example 2: yarn for mac curl -o- -L https://yarnpkg.com/install.sh | bash