dependencydoctor
v1.0.6
Published
Scan node_modules for version fragmentation and print actionable fixes.
Maintainers
Readme
Dependency Doctor
A CLI tool to scan your node_modules and detect dependency version conflicts.
Outputs structured JSON (or human-readable) so you can quickly see which packages are fragmented and how to unify them.
Why?
Large node_modules often install multiple major versions of the same package.
This tool flags where versions can be safely unified and where major conflicts exist.
Features
Scans all installed dependencies (nested too)
Groups by package + version
Flags conflicts in plain English
- ✅ Safe to unify → all consumers accept the same version
- 🔒 Locked to version → a dependency is pinned to one version, blocking deduplication
- ⚠️ Major version conflict → consumers demand different major versions, no single version works
Prints actionable suggestions (upgrade, downgrade, or accept duplication)
Install
npm install -g dependencydoctorOr run once with npx:
npx dependencydoctor
npx dependencydoctor --jsonUsage
dep-doctor
dep-doctor --json # machine-friendly outputExample Output
Conflict: semver
Installed: 7.7.2 @ node_modules/aws-cdk-lib/node_modules/semver
Installed: 7.3.4 @ node_modules/@amzn/motecdk/node_modules/semver
Status: ⚠️ Major version conflict
→ No single version satisfies all constraints.
Plan A: Upgrade @amzn/motecdk to a version that uses semver@^7.7
Plan B: Downgrade aws-cdk-lib to a version compatible with semver@^7.3