Languages
[Edit]
EN

Node.js - dependencies and dev dependencies

3 points
Created by:
Geospatial-Palus
660

In this article, we would like to show you the difference between dependencies and dev dependencies in Node.js.

Dependencies

Edit

When you install an npm package locally you install it as a normal dependency.

It is automatically added to the package.json file to the depencencies list.

Example package.json with dependencies:

Note:

Go to the following article to see how to install npm package locally:

Dev dependencies

Edit

To install npm package as devDependencies, you need to add -D flag (or --save-dev) to the npm install command:

or:

The development dependencies are required only during the development process (e.g unit testing).

They are added to the package.json file to the devDependency list.

Example package.json with devDependencies list:

Alternative titles

  1. Node.js - normal dependencies and dev dependencies
  2. Node.js - dependencies vs dev dependencies
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join