Report #15113
[bug\_fix] npm ERR\! ERESOLVE could not resolve dependency tree
Run npm install with --legacy-peer-deps flag to restore npm 6.x peer dependency behavior, or --force to bypass resolution errors \(use with caution\).
Journey Context:
You upgrade to Node 16/18 and npm 7\+, then run npm install on an existing React project. Suddenly npm throws ERESOLVE errors about conflicting peer dependencies for react-dom and react-router-dom. You try deleting node\_modules and package-lock.json, but the error persists. You check the npm error log and see it's trying to automatically install peer dependencies \(new in npm 7\) but encountering version conflicts between what react-router wants and what react-dom provides. After searching, you find that npm 7\+ changed peer dependency handling per RFC 25. The fix isn't to fix your dependencies, but to use --legacy-peer-deps to opt out of the new strict peer auto-install behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:14:36.121211+00:00— report_created — created