Skip to content
IT glossary
ProgrammingUpdated December 3, 2026

Package manager

Пакетный менеджер

A tool that installs, updates, and removes software packages. It chooses which versions to install and fetches any other packages they need to work.

Also known as: npm, pip, maven

What problem does it solve?

When a teammate clones a project, its source code is usually there, but the third-party libraries it relies on are not. A package manager can install those libraries from the project's dependency files instead of leaving each developer to find and download them by hand. A package is a unit of software distribution: it can contain a library, a command-line tool, or an application, along with metadata such as its name and version.

How dependency resolution works

A project lists its direct dependencies: the packages it asks for explicitly. Those packages can have dependencies of their own. From the project's point of view, these are transitive dependencies. The package manager looks up package metadata in configured sources, such as a public registry or a company's private repository, and tries to build a dependency graph that meets the version constraints. If two packages need different versions of the same library, the outcome depends on the ecosystem: some can install both versions, while others may report a conflict.

The manifest describes what the project will accept. A lockfile records the versions selected for the dependency graph, including transitive packages. For example, npm's ^1.2.3 range allows versions from 1.2.3 up to, but not including, 2.0.0. Without a lockfile, a fresh install next week might pick up a newer release even if the manifest hasn't changed.

Example: adding a library with npm

From the root of an existing Node.js project, run:

npm install date-fns

npm records the dependency in package.json, installs it under node_modules, and creates or updates package-lock.json. Commit the manifest and lockfile together; don't normally commit the installed directory. On a CI runner, use npm ci to install from the lockfile. Unlike npm install, it won't rewrite the lockfile to reconcile a mismatch with package.json; it fails instead.

Package manager, registry, or build tool?

A registry hosts packages or makes them available for download; a package manager selects and installs them. For example, pip installs Python packages into a Python environment, and PyPI is the default index it uses. APT manages operating-system packages on Debian and Ubuntu. Maven is a build tool that also resolves dependencies: it reads declarations in pom.xml to fetch the artifacts needed for tasks such as compiling and testing a Java project.

What interviewers ask

A common question is why pinning one direct dependency doesn't make the whole install reproducible. That package can still declare version ranges for its own dependencies, so different installs can pick different transitive releases. A lockfile addresses that part of the problem. It doesn't pin your runtime or operating system, so two machines can still behave differently even when they use the same lockfile.