Dev Dependencies
In package.json file, there is an object called as dev Dependencies and it consists of all the packages that are used in the project in its development phase and not in the production or testing environment with its version number. So, whenever you want to install any library that is required only in your development phase then you can find it in the dev Dependencies object.
Use the below command to add more dev Dependencies in your project:
npm install <package name> --save-dev
Example: Installing the bootstrap module that we want to use in the development phase only and not in the production or testing phase for the project, use the following command:
npm install bootstrap --save-dev
package.json:
"devDependencies": {
"bootstrap": "^5.3.2",
}
Difference between dependencies, devDependencies and peerDependencies
Every web application project typically includes a file named package.json, which serves as a repository of essential project metadata. This file encompasses information ranging from dependencies and their respective versions to development dependencies and peer dependencies.
Run the following command to initialize the project from the root directory of your project:
npm init -y
Contact Us