A package manifest is a structured metadata file that describes a software package: its name, version, dependencies, entry points, scripts and licensing information. In software installation and package management, the manifest is the document a package manager reads first to decide what to download, how to build it and how the package relates to others.
The best-known example is package.json in the Node.js ecosystem, but nearly every ecosystem has an equivalent, such as Cargo.toml for Rust, pyproject.toml for Python and pom.xml for Java. The manifest states intent, usually as version ranges, while a separate dependency lock file records the exact versions that were actually resolved.
What a package manifest contains
A package manifest combines identity, requirements and behavior in one machine-readable file. Identity fields let registries index the package, requirement fields drive dependency resolution, and behavior fields tell tools how to build, test or launch the code.
The following table lists the fields found in most manifests, using package.json names as the reference.
| Field | Purpose | Example value |
|---|---|---|
| name | Unique identifier in the registry | invoice-parser |
| version | Release number, usually semantic versioning | 2.4.1 |
| dependencies | Packages required at runtime | A library with range ^3.2.0 |
| devDependencies | Packages needed only for development | A test framework |
| peerDependencies | Packages the host project must supply | A UI framework version |
| scripts | Named commands for build and test tasks | build, test, lint |
| license | License identifier, ideally SPDX | MIT |
| engines | Supported runtime versions | Node.js 18 or later |
Formats vary: JSON is common in JavaScript, TOML in Rust and modern Python, XML in Maven and YAML in several container and mobile ecosystems. The format affects whether comments are allowed and how easily humans edit the file, but the conceptual content is similar.
How package managers use the manifest
When a developer runs an install command, the package manager parses the manifest, resolves the dependency tree and fetches each package from a registry or cache. Version ranges such as ^1.4.0, which allows any compatible 1.x release from 1.4.0 upward, give the resolver room to choose versions that satisfy every constraint at once.
Resolution expands into transitive dependencies, because each dependency has its own manifest. A small project with ten direct dependencies can easily install several hundred packages in total, which is why the manifest alone does not guarantee identical installs across machines.
The table below summarizes common version constraint notations and their effect.
| Notation | Meaning | Risk profile |
|---|---|---|
| Exact (2.4.1) | Only that release | Stable, but misses security fixes |
| Caret (^2.4.1) | Compatible releases below 3.0.0 | Balanced, relies on semantic versioning |
| Tilde (~2.4.1) | Patch releases below 2.5.0 | Conservative updates |
| Range (>=2.0 <3.0) | Any release within the bounds | Flexible, harder to predict |
| Wildcard (*) | Any release at all | Unpredictable and unsafe |
Package manifest compared with lock files and other metadata
The manifest and the dependency lock file serve complementary roles. The manifest is written by people and expresses acceptable ranges, whereas the lock file is generated by tools and pins every resolved package, including transitive ones, to an exact version and integrity hash.
The following table compares the manifest with related files that often sit beside it.
| File | Written by | Content | Committed to version control |
|---|---|---|---|
| Package manifest | Developers | Identity, ranges, scripts | Always |
| Lock file | Package manager | Exact resolved versions and hashes | Yes for applications |
| Configuration file | Developers | Tool or runtime settings | Usually |
| Install script | Developers | Imperative setup steps | Yes, with review |
Manifests also appear outside language ecosystems. Operating system packages carry control files, browser extensions and mobile apps declare permissions in their own manifests, and container images use manifest documents listing layers and platforms. The shared idea is a declarative description that tooling can trust.
Writing and maintaining a reliable manifest
A well-maintained manifest keeps dependencies minimal, accurate and correctly classified. Placing a test framework in runtime dependencies inflates production installs, while omitting a required peer dependency causes failures that appear only in consumers’ projects.
- Use semantic versioning for the package’s own version so that consumers can trust caret ranges.
- Declare supported runtimes in fields such as engines to fail early on incompatible environments.
- Record an SPDX license identifier so that compliance tools can audit the dependency tree automatically.
- Review install scripts carefully, because lifecycle hooks run arbitrary code on every machine that installs the package.
Teams typically pair the manifest with automated dependency updates that open change requests when new versions appear. The manifest then changes in small, reviewable steps instead of large upgrades that combine many breaking changes.
Common manifest problems and their fixes
Most manifest problems surface as failed installs, inconsistent builds or security alerts. The table below links typical symptoms to their usual causes.
| Symptom | Likely cause | Fix |
|---|---|---|
| Works locally, fails in CI | Loose ranges without a committed lock file | Commit the lock file and install from it |
| Unresolvable dependency conflict | Incompatible ranges among packages | Widen a range or upgrade the conflicting package |
| Bloated production image | Development tools listed as runtime dependencies | Move them to development dependencies |
| Unexpected code at install time | Malicious or compromised lifecycle script | Disable scripts by default and audit packages |
| Registry rejects publication | Duplicate name or reused version number | Rename the package or bump the version |
A frequent misconception is that the manifest alone reproduces an environment. Without a lock file, two installs a week apart can resolve different versions, so reproducibility depends on manifest and lock file together.
A plain-language summary
A package manifest works like the label and ingredient list on a product. It says what the software is called, which version it is and which other pieces it needs in order to work.
Installation tools read this label and fetch everything listed on it automatically. Without a manifest, people would have to collect every required piece by hand, and mistakes would be far more common.
An example from practice
A front-end team maintains a customer portal built with Node.js. Its package.json lists 24 direct dependencies with caret ranges, and the install command expands them into about 900 packages. New developers kept reporting different behavior on their laptops than on the build server.
An engineer found that the lock file had been excluded from version control, so each machine resolved slightly different versions. The team committed the lock file, switched the build server to a clean install from it, moved six testing tools into devDependencies and added an engines field requiring Node.js 20. Builds became identical across all machines, and the production container shrank by roughly 140 MB.