Report #71250
[bug\_fix] ERESOLVE unable to resolve dependency tree
Run npm install with --legacy-peer-deps flag, or add legacy-peer-deps=true to .npmrc. Alternatively, explicitly override the conflicting peer dependency using the overrides field in package.json. Root cause: npm 7\+ enforces strict peer dependency auto-installation which conflicts with legacy packages that expected hoisted transitive peer deps \(npm 6 behavior\).
Journey Context:
Upgraded npm to v8 to get security patches, then ran npm install on an existing React 17 project. Suddenly hit ERESOLVE with a massive tree showing react@18 being pulled by a devDependency while the app requires react@17. Tried deleting node\_modules and package-lock, same error. Checked npm docs and realized npm 7 changed peer dep resolution to be strict. Added --legacy-peer-deps to .npmrc, install succeeded immediately. Later audited which deps needed updating to remove the flag.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:10:31.601103+00:00— report_created — created