Skip to content
IT glossary
ProgrammingUpdated December 3, 2026

Dependency

Зависимость

A program has a dependency when it relies on another component to build or work. For example, a reporting tool might need a library to generate PDFs.

Also known as: dependency hell

What it means to depend on something

If the checkout module calls a function from the pricing module, checkout depends on pricing. The relationship has a direction: changing pricing's interface might break checkout, but pricing doesn't need to know who calls it. Dependencies aren't limited to downloaded packages. Your source code can depend on another module in the same repository, and a running application can depend on a database or an external API. Not every dependency is needed at every stage: a test runner may be required in CI without being part of the deployed application.

How package dependencies are resolved

A direct dependency is one your project declares itself. A transitive dependency is pulled in by a dependency, possibly several steps down the chain. The result is a graph rather than necessarily a tree: two packages can both require the same third package.

Package manifests state what versions are acceptable. For example, an npm package.json entry with ^2.1.0 allows stable releases from 2.1.0 up to, but not including, 3.0.0. The package manager resolves those constraints, and package-lock.json records the chosen versions, including transitive ones. An application team typically commits its lockfile so that developers and CI install the same resolved versions. The lockfile records a resolution; it doesn't prove that the packages behave correctly together.

Example: when version requirements clash

Suppose your app uses a reporting package that requires format-core 1.x and a charting package that requires 2.x. If the environment can load only one version of format-core, neither choice satisfies both packages. Some package managers can install separate copies, but that won't help if both packages are plugins that must use the same host library.

Dependency hell is the situation where overlapping or incompatible requirements make an application hard to install, run, or upgrade. It's not another name for an ordinary dependency. Start by finding which packages impose the conflicting requirements. You might be able to upgrade the reporting package to a release that supports 2.x, or replace it if no compatible release exists. Forcing a version can silence the resolver without fixing the underlying incompatibility, so test the affected behavior rather than treating a successful install as proof.

How it comes up in interviews

You might be asked why a package appears in an install even though it isn't listed in the project's manifest. Explain the chain (app → report package → format-core) and name a way to inspect it, such as npm ls format-core. If the app imports format-core itself, declare it directly: the reporting package could stop bringing it in after an update. If the question is about dependency injection instead, distinguish the two concepts: injection is about how code receives a collaborator, such as a pricing service, not how a package manager chooses a version.