NPM vs. YARN: Basic Commands

Here is a quick reference guide for basic commands that we can use when dealing with Node and requiring the use of NPM or YARN.

Install dependencies from package.json:

npm install == yarn

Install a package and add to package…


This content originally appeared on DEV Community and was authored by vandna kapoor

Here is a quick reference guide for basic commands that we can use when dealing with Node and requiring the use of NPM or YARN.

  • Install dependencies from package.json:

    npm install == yarn

  • Install a package and add to package.json:

    npm install package --save == yarn add package

  • Install a devDependency to package.json:

    npm install package --save-dev == yarn add package --dev

  • Remove a dependency from package.json:

    npm uninstall package --save == yarn remove package

  • Upgrade a package to its latest version:

    npm update --save == yarn upgrade

  • Install a package globally:

    npm install package -g == yarn global add package


This content originally appeared on DEV Community and was authored by vandna kapoor


Print Share Comment Cite Upload Translate Updates
APA

vandna kapoor | Sciencx (2021-11-24T21:16:05+00:00) NPM vs. YARN: Basic Commands. Retrieved from https://www.scien.cx/2021/11/24/npm-vs-yarn-basic-commands/

MLA
" » NPM vs. YARN: Basic Commands." vandna kapoor | Sciencx - Wednesday November 24, 2021, https://www.scien.cx/2021/11/24/npm-vs-yarn-basic-commands/
HARVARD
vandna kapoor | Sciencx Wednesday November 24, 2021 » NPM vs. YARN: Basic Commands., viewed ,<https://www.scien.cx/2021/11/24/npm-vs-yarn-basic-commands/>
VANCOUVER
vandna kapoor | Sciencx - » NPM vs. YARN: Basic Commands. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/24/npm-vs-yarn-basic-commands/
CHICAGO
" » NPM vs. YARN: Basic Commands." vandna kapoor | Sciencx - Accessed . https://www.scien.cx/2021/11/24/npm-vs-yarn-basic-commands/
IEEE
" » NPM vs. YARN: Basic Commands." vandna kapoor | Sciencx [Online]. Available: https://www.scien.cx/2021/11/24/npm-vs-yarn-basic-commands/. [Accessed: ]
rf:citation
» NPM vs. YARN: Basic Commands | vandna kapoor | Sciencx | https://www.scien.cx/2021/11/24/npm-vs-yarn-basic-commands/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.