Nov 06, 2016 · Here’s the command to install Yarn globally: npm install yarn -g. Now let’s run Yarn from within the root dir of our project: yarn. This command reads (an equivalent of npm install) the list dependencies from your package.json file and installs all of them either from npmjs.org or from local cache.