Report #100971
[bug\_fix] npm ERR\! code ERESOLVE npm ERR\! ERESOLVE could not resolve npm ERR\! Found: [email protected] npm ERR\! node\_modules/react
Run npm install with --legacy-peer-deps, or explicitly install a compatible version of the conflicting peer dependency, or add overrides in package.json. The cleanest long-term fix is to upgrade the package that declares the stale peer dependency to a version compatible with the installed one.
Journey Context:
You clone a repo from six months ago and run npm install. npm churns for a while, then dumps a dependency tree showing [email protected] is installed but [email protected] wants react@^17.0.0. You try deleting node\_modules and package-lock.json and reinstalling, and get the same failure. You google the error and learn npm 7\+ treats peer-dependency conflicts as hard failures instead of warnings like npm 6 did. You try --force first; it installs but feels unsafe. Then you try --legacy-peer-deps, which tells npm to use the pre-v7 peer-dependency resolution algorithm. That works locally, but you realize the real fix is updating some-package to a version that supports React 18, or explicitly pinning react to 17 if the project actually requires it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:45:41.175110+00:00— report_created — created