Lockfile
A generated file recording the exact dependency versions an install resolved to.
A lockfile records the exact resolved version of every direct and transitive dependency, so that installing from it reproduces the same tree on every machine. Manifests state ranges; lockfiles state facts. Committing one is what makes builds reproducible.
Lockfiles are generated artifacts and should be treated as such: regenerate rather than hand-edit, and review the diff for surprises rather than for style.
One structural detail causes recurring confusion. Lockfiles typically contain two kinds of information: an echo of the declared ranges from every manifest, and the map of resolved packages. Tightening a range in a manifest necessarily changes the first, so "the lockfile diff must be empty" is an impossible standard — the honest check is whether the resolved half changed. Diffing the resolution section alone distinguishes an intentional pin from an unintended re-resolution.
A second: how installed packages are laid out on disk is a property of the package manager's linking strategy, not of the lockfile, so reading a version out of an installed directory may be wrong or may find nothing. The lockfile's resolution map is the answer. See Package Manager and Monorepo.
See also4
Package Manager
The tool that resolves, fetches, and installs dependencies, and pins them for reproducibility.
Systems & Tooling16 connections
Semantic Versioning
A version-numbering convention where the number communicates the kind of change.
Version Control & Delivery14 connections
Determinism
The property that identical inputs produce identical outputs, and the foundation of caching and verification.
Systems & Tooling56 connections
Supply Chain Security
Protecting against compromise arriving through the code and tooling a project depends on.
Version Control & Delivery13 connections
Related3
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from5
- CopyleftVersion Control & Delivery
A licensing strategy that uses copyright to require derivative works to stay open.
- MonorepoSystems & Tooling
Several packages developed in one repository with shared tooling and atomic cross-package changes.
- Package ManagerSystems & Tooling
The tool that resolves, fetches, and installs dependencies, and pins them for reproducibility.
- Semantic VersioningVersion Control & Delivery
A version-numbering convention where the number communicates the kind of change.
- Supply Chain SecurityVersion Control & Delivery
Protecting against compromise arriving through the code and tooling a project depends on.