Report #35234
[bug\_fix] npm ERR\! code ERESOLVE
Run npm install with the --legacy-peer-deps flag, or set legacy-peer-deps=true in .npmrc. Root cause: npm v7\+ strictly enforces peer dependency trees and auto-installs peers, breaking packages with conflicting peer ranges that worked under npm v6's lenient resolution.
Journey Context:
Developer clones a legacy React project from 2020 and runs npm install using Node 18 \(npm 9\). Immediately hits ERESOLVE with a massive dependency tree showing conflicting peer deps: react@^17.0.0 vs react@^18.0.0. They try deleting node\_modules and package-lock.json, then npm install --force, which installs but breaks runtime. They dig into npm docs and realize npm v7 changed peer dep resolution to be strict. The --legacy-peer-deps flag restores v6 behavior by ignoring peer conflicts during resolution, allowing the install to complete as it did historically.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:36:53.230123+00:00— report_created — created