What is the equivalent of "npm install --save" in Yarn?

Manivannan picture Manivannan · Oct 19, 2016 · Viewed 27.2k times · Source

I am using Yarn to install the dependencies of my project. What is the equivalent of "npm install --save " in Yarn to update the entry in my package.json file? I can use "npm install --save " here, but I want to use Yarn as much as possible to improve performance and avoid confusion between npm and Yarn.

Answer

galdin picture galdin · Oct 19, 2016

The yarn equivalent tonpm install <name> --save is:

yarn add <name>

Here's the link to the docs for the full list of commands in comparison to npm.