How to fix npm ERR! code ERESOLVE npm ERR! ERESOLVE overriding peer dependency is not allowed in npm
An override you set conflicts with dependency resolution. Adjust or remove the override, or align versions so the override matches the graph.
Quick fix
Fixes npm ERR! code ERESOLVE npm ERR! ERESOLVE overriding peer dependency is not allowed
rm -rf node_modules package-lock.json
npm install- Inspect the ERESOLVE output
- Adjust or remove the override
- Align dependent packages if needed
- Reinstall cleanly
rm -rf node_modules package-lock.jsonnpm installnpm ERR! code ERESOLVEnpm ERR! ERESOLVE overriding peer dependency is not allowed
What this error means
npm overrides (package.json "overrides") force specific versions. If the forced version conflicts with peer/dep requirements, the resolver errors with ERESOLVE override conflict.
Typical symptoms
- npm install fails with ERESOLVE and mentions overrides
- Override version does not satisfy declared peer ranges
- Install only succeeds if override is removed
Common causes
- Override forces a version outside peer ranges
- Multiple overrides clash on the same dependency
- Override pins an older major incompatible with dependents
How to fix "npm ERR! code ERESOLVE npm ERR! ERESOLVE overriding peer dependency is not allowed"
Read which package and version the override is forcing and what peer/dep range it violates.
Pick a version that satisfies peers, or delete the override entirely and let npm resolve naturally.
Upgrade/downgrade the dependent package so its peers match the override target.
Refresh resolution after changes:
rm -rf node_modules package-lock.json
npm installAdvanced notes
Use overrides sparingly—prefer upgrading the real dependency. Overrides that fight peers often cause runtime breakage.
Frequently asked questions
- What does "npm ERR! code ERESOLVE npm ERR! ERESOLVE overriding peer dependency is" mean?
- json "overrides") force specific versions. If the forced version conflicts with peer/dep requirements, the resolver errors with ERESOLVE override conflict.
- How do I fix "npm ERR! code ERESOLVE npm ERR! ERESOLVE overriding peer dependency is"?
- An override you set conflicts with dependency resolution. Adjust or remove the override, or align versions so the override matches the graph.
- What causes "npm ERR! code ERESOLVE npm ERR! ERESOLVE overriding peer dependency is"?
- Override forces a version outside peer ranges Multiple overrides clash on the same dependency Override pins an older major incompatible with dependents
- Is the "npm ERR! code ERESOLVE npm ERR! ERESOLVE overriding peer dependency is" error serious?
- It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- 📚npm Official Documentation
- 📖npm Docs: overrides(Official Docs)
- 📖npm Docs: legacy-peer-deps(Official Docs)
- 💬Stack Overflow: npm overrides conflicts(Stack Overflow)
- 🐙