Sitemap
Better Programming

Advice for programmers.

Follow publication

credit: unsplash

Member-only story

An In-Depth Explanation of package.json’s Dependencies

Dependencies, devDependencies, and peerDependencies: What do they mean?

6 min readDec 23, 2019

If you use npm (Node Package Manager) to manage a JavaScript project, it is vital to structure dependencies correctly in your package.json. Just one npm command, npm install, can install all dependent packages based on the specification.

With the emerging micro-frontends and monorepo approaches, the interrelationship between dependencies becomes ever more challenging.

This article describes different types of dependencies in package.json, and shows a few solutions we’ve adopted regarding peerDependencies issues during our product development. In the end, we talk about external dependencies.

Types of Dependencies

There are five types of dependencies defined in the npm documentation:

1. Normal dependencies

The normal dependencies: These dependent packages serve as libraries to make a project work.

The final product must be bundled with these packages, which might be frameworks (such as React, Angular, Vue, etc.), utilities (such as i18next, Lodash, axios, etc.), and subcomponents in your organization.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (2)

Write a response

Can't support this form
To protect your security while using Google Translate, please do not submit information in this type of form.
Got itGo to original URL