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

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