how to install package globally yarn code example Example 1: install yarn npm install -g yarn Example 2: yarn add install all packages in package,json yarn install