Found this repo and want to add peer dependency checking to your existing project? Here's how to do it in 30 seconds:
# Go to your project directory
cd my-awesome-project
# Run the setup (works with any package manager)
npx peer-dependency-checker setupThat's it! ✨
The setup command automatically:
- Detected your package manager (npm, yarn, pnpm, or bun)
- Installed peer-dependency-checker as a devDependency
- Added scripts to your package.json:
{ "scripts": { "preinstall": "pdc scan --quick || true", "postinstall": "pdc analyze --brief || true", "pdc:scan": "pdc scan", "pdc:check": "pdc scan --quick || true" } } - Created
.pdcrc.jsonconfiguration file - Tested everything works
# This will now check for peer dependency conflicts first!
npm install react@19 react-dom@19
# Manual scanning
npm run pdc:scan
# Check specific packages
npx pdc check lodash@5| Package Manager | Install Command | Auto-detected |
|---|---|---|
| npm | npm install react@19 |
✅ |
| yarn | yarn add react@19 |
✅ |
| pnpm | pnpm add react@19 |
✅ |
| bun | bun add react@19 |
✅ |
{
"devDependencies": {
"peer-dependency-checker": "^1.0.0"
},
"scripts": {
"preinstall": "pdc scan --quick || true",
"postinstall": "pdc analyze --brief || true",
"pdc:scan": "pdc scan",
"pdc:check": "pdc scan --quick || true",
"pdc:analyze": "pdc analyze --brief || true"
}
}{
"packageManager": "npm",
"riskTolerance": "medium",
"autoCheck": true,
"checkOnInstall": true,
"checkOnUpgrade": true,
"excludePackages": [],
"includeDevDependencies": true,
"outputFormat": "colored"
}When you install dependencies after setup:
$ npm install react@19 react-dom@19
🔍 Running peer dependency check...
✅ COMPATIBLE
• react@19.1.0 - No conflicts detected
• react-dom@19.1.0 - Requires react ^19.0.0 ✅
📦 Installing packages...
npm WARN peer dep typescript@5.0.0 requires @types/react@^19.0.0
⚠️ Consider also updating: @types/react@19
🔍 Post-install analysis...
✅ All peer dependencies satisfiedEdit .pdcrc.json to customize behavior:
{
"riskTolerance": "low", // "low" | "medium" | "high"
"excludePackages": ["legacy-pkg"], // Skip certain packages
"checkOnInstall": true, // Auto-check on install
"outputFormat": "json" // "colored" | "json" | "minimal"
}# Remove the package
npm uninstall peer-dependency-checker
# Remove scripts from package.json (manual)
# Delete .pdcrc.json fileSetup fails?
# Try global install first
npm install -g peer-dependency-checker
pdc setupScripts not running?
# Test manually
npx pdc scanNeed help?
That's it! Your project now has intelligent peer dependency checking. Every time you or your team installs dependencies, potential conflicts will be caught before they break your build. 🎉