Quantcast
Viewing all articles
Browse latest Browse all 39

Answer by Kodali444 for What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?

The difference between these two is that devDependencies are modules that are only required during development, while dependencies are modules that are also required at runtime.

To save a dependency as a devDependency on installation we need to do an #npm install --save-dev, instead of just an #npm install --save

A nice shorthand for installing a devDependency that I like to use is #npm i -D. The shorthand for saving a regular dependency is -S instead of -D.

Some good examples of dependencies that would be required at runtime include React, Redux, Express, and Axios.

Some good examples of when to install devDependencies would be Nodemon, Babel, ESLint, and testing frameworks like Chai, Mocha, Enzyme, etc…


Viewing all articles
Browse latest Browse all 39

Trending Articles