Peer Dependencies
In package.json file, there is an object called as peerDependencies and it consists of all the packages that are exactly required in the project or to the person who is downloading and the version numbers should also be the same. That is the reason they were named as peerDependencies. The best example is ‘react’ which is common in every project to run similarly.
Note: These dependencies are not automatically installed. npm gives a warning message whenever there is a peer Dependency and these are different dependencies compared to the above-discussed dependencies.
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