To install yarn using the npm package manager, which is the best way to install, run - > npm install -g yarn or in the case of Ubuntu or Linux, use sudo $ sudo npm install -g yarn