Resolves dependency conflicts in npm, yarn, and pnpm projects. Provides diagnostic commands and strategies for peer dependency warnings, version mismatches, and duplicate packages.
Ships in debug-detective. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Untangle and resolve package dependency conflicts.
npm WARN ERESOLVE unable to resolve dependency tree
npm WARN peer react@"^17.0.0" from [email protected]
npm WARN peer react@"^18.0.0" from [email protected]
Cause: Two packages require different versions of the same peer dependency.
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@">=4.0 <5.0" from [email protected]
npm ERR! node_modules/some-package
npm ERR! some-package@"^1.0.0" from the root project
Cause: Package requires a version range you're not using.
warning "package-a" has unmet peer dependency "lodash@^4.0.0".
warning "package-b" has incorrect peer dependency "lodash@^3.0.0".
Cause: Multiple versions of the same package installed.
# See dependency tree
npm ls
# Find specific package
npm ls react
# Find why package is installed
npm why lodash
# Check for outdated packages
npm outdated
# Audit for issues
npm audit
# See dependency tree
yarn list
# Find specific package
yarn why react
# Check for duplicates
yarn dedupe --check
# Interactive upgrade
yarn upgrade-interactive
# See dependency tree
pnpm ls
# Find specific package
pnpm why react
# List all versions of a package
pnpm ls --depth Infinity | grep lodash
# Find what versions are needed
npm ls react --all
# Update packages that need newer version
npm update package-a package-b
# Or install specific compatible version
npm install [email protected]
NPM (package.json):
{
"overrides": {
"react": "18.2.0",
"package-a": {
"lodash": "4.17.21"
}
}
}
Yarn (package.json):
{
"resolutions": {
"react": "18.2.0",
"**/lodash": "4.17.21"
}
}
PNPM (package.json):
{
"pnpm": {
"overrides": {
"react": "18.2.0",
"lodash@^3.0.0": "4.17.21"
}
}
}
# NPM - force through conflicts
npm install --legacy-peer-deps
# Or with force flag
npm install --force
# Yarn
yarn install --ignore-peer-deps
Warning: This can lead to runtime errors. Use only when you've verified compatibility.
# NPM
npm dedupe
# Yarn
yarn dedupe
# PNPM (automatic, but can force)
pnpm install
# NPM - full tree
npm ls --all > deps.txt
# Find the conflict path
grep -B5 "lodash@3" deps.txt
Example output:
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected] <- Conflict source
# View package.json of installed package
cat node_modules/package-name/package.json | jq '.peerDependencies'
# Or use npm view
npm view package-name peerDependencies
npm WARN [email protected] requires react@^18.2.0, but [email protected] is installed
Solution:
# Upgrade React
npm install react@18 react-dom@18
# Or if you need React 17
npm install react-dom@17
error TS2307: Cannot find module '@types/node' or its corresponding type declarations.
Solution:
# Check TypeScript version
npx tsc --version
# Install compatible types
npm install -D @types/node@ts$(npx tsc --version | cut -d' ' -f2 | cut -d'.' -f1-2)
# Or specific version
npm install -D @types/node@20
npm ERR! node-pre-gyp ERR! build error
Solution:
# Rebuild native modules
npm rebuild
# Or for specific package
npm rebuild bcrypt
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
error Workspaces can only be enabled in private projects.
Solution in package.json:
{
"private": true,
"workspaces": [
"packages/*"
]
}
# Don't manually resolve - regenerate
git checkout --theirs package-lock.json
npm install
# Or
rm package-lock.json
npm install
# NPM
rm package-lock.json
npm install
# Yarn
rm yarn.lock
yarn install
# PNPM
rm pnpm-lock.yaml
pnpm install
{
"dependencies": {
"lodash": "4.17.21", // Exact version
"react": "^18.2.0", // Minor updates OK
"express": "~4.18.0" // Patch updates only
}
}
# Always commit lock files
git add package-lock.json # or yarn.lock, pnpm-lock.yaml
# CI should use ci command
npm ci # instead of npm install
# Check for updates regularly
npm outdated
# Update incrementally
npm update
# Use tools like renovate/dependabot
Help me resolve this dependency conflict:
**Error message:**
[paste full error]
**Current package.json dependencies:**
```json
[paste dependencies]
What I've tried:
Please:
## Best Practices
1. **Read the full error** - It usually tells you what's wrong
2. **Check compatibility** - Before installing new packages
3. **Use lock files** - For reproducible installs
4. **Update regularly** - Small updates are easier than big jumps
5. **Test after resolving** - Conflicts can cause runtime issues
6. **Document workarounds** - Future you will thank you
7. **Avoid force** - Unless you understand the consequences
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
dependency-conflict, npm, yarn, pnpm, package-management, peer-dependency
/debug-detective:dependency-conflict-resolverfrom debug-detective
npx claudepluginhub latestaiagents/agent-skills --plugin debug-detective6 skills in this plugin
/error-pattern-analyzerUse this skill when analyzing error patterns in applications. Activate when the user has recurring errors,
wants to find root causes of issues, needs to identify systemic problems, is analyzing error logs,
or wants to categorize and prioritize bugs.
/log-forensicsUse this skill when investigating issues through logs. Activate when the user needs to analyze log files,
search for specific events in logs, correlate logs across services, investigate incidents through logs,
or extract insights from application logs.
/performance-profiler4 plugins in one repository ship this exact skill · first indexed Aug 19, 2026
Other plugins' skills for the same job