package.json Validator

Validate a package.json file for common issues: missing required fields (name, version), invalid semver, missing main/exports for libraries, files-array problems, scripts that reference undefined commands, dependency duplication between deps and devDeps.

How to use the package.json Validator

Paste your package.json. The validator reports structural issues, semver problems, and questionable patterns. It doesn't run npm install — runtime issues (missing peer deps, version conflicts) need npm ls or a real installer.

Validating a package.json

package.json is the manifest every Node tool reads, and small mistakes in it cause outsized problems: an invalid semver string, a missing main or exports entry that makes a published library unimportable, a dependency listed in both dependencies and devDependencies, or a script pointing at a binary that was never installed. Many of these fail quietly until a publish or a CI install.

This checks a package.json for required fields, semver validity, library entry points, files-array problems, and dependency duplication, reporting issues without running an install. It does not resolve the dependency graph — for peer-dependency or version-conflict problems reach for npm ls or a real installer; to estimate what a dependency weighs before adding it, the npm size estimator, and to bump the version field correctly, the semver bumper.

Common use cases

  • Pre-publish check — catch manifest errors before npm publish.
  • Validate semver — confirm the version string is well-formed.
  • Library entry points — verify main/exports so the package imports.
  • Spot duplication — find deps listed in both dependencies and devDependencies.
  • CI sanity — fail fast on a malformed manifest.

Frequently asked questions

Does it run npm install?

No — it inspects the file statically; runtime resolution needs npm ls or an installer.

What does it check for libraries?

That main/exports are present and the files array is sensible, so the package is importable once published.

Will it catch version conflicts?

No — conflicting or missing peer deps need a real installer; this validates the structure of the manifest.

How do I bump the version safely?

Use the semver bumper to increment major, minor, or patch correctly.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: