The ERESOLVE error occurs when npm cannot find a version that satisfies all dependency requirements. This typically indicates conflicting peer dependencies or impossible version constraints.
npm 7+ introduced stricter peer dependency handling. ERESOLVE occurs when npm's dependency resolver cannot find a valid dependency tree - usually because different packages require conflicting versions of the same dependency. This error provides detailed information about which packages are conflicting, helping you understand and resolve the dependency conflict.
npm shows detailed conflict info:
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.0" from [email protected]This shows exactly what conflicts.
Use npm 6 style dependency resolution:
npm install --legacy-peer-depsThis ignores peer dependency conflicts like npm 6 did.
Force installation (use cautiously):
npm install --force⚠️ This may cause runtime issues if dependencies truly are incompatible.
Find compatible versions:
# Check for updates
npm outdated
# Update specific package
npm update package-name
# Check peer dependencies
npm view some-package peerDependenciesForce specific versions:
{
"overrides": {
"react": "18.2.0"
}
}This forces all packages to use your specified version.
If a package causes persistent issues:
1. Check for newer version
2. Look for fork with updated deps
3. Consider alternative package
4. Open issue with package maintainer
ERESOLVE is often encountered when upgrading major versions (React 17 to 18, etc.). The npm overrides feature (npm 8.3+) allows forcing specific versions throughout the tree. For Yarn users, the resolutions field provides similar functionality. Consider using npm-check-updates to identify safe upgrade paths. In monorepos, hoist conflicts may require per-package overrides.
npm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name: tag names cannot contain spaces
How to fix "npm ERR! code EINVALIDTAGNAME - tag names cannot contain spaces"
npm ERR! code E400 npm ERR! 400 Bad Request
How to fix "npm ERR! code E400 - 400 Bad Request" error