Online Forum To Support Coders With Technical Assistance - Read Write Execute

What is the difference between –save and –save-dev in Node.js ?

Ankit Agrawal
Ankit Agrawal
Published on February 7, 2022 · 1 min read

NPM (Node Package Manger ) is a package manager and a installer. It’s a world’s largest software registry.NPM is free to use and it’s include a CLI ( command line client) to download and install software.

There are two commonly used command to install software

1 : npm install –save [package-name]

2 : npm install –save-dev [package-name]

Both commands used to install packages but there are some minor difference in both.

npm install –save [package-name] : when we use this command it means this package is core dependency for the project and project can not be run without it. All core packages are listed under dependencies in package.json.

Example : express

npm install –save-dev [package-name] : when we use this command it means this package is development dependency for the project and project can run without it. All development packages are listed under dev dependencies in package.json.

Example : nodemon

 

 

Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article Convert object into query string in javascript Next Article → How to disable redirect to product page instead of search page in woocommerce