Report #103402
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Run \`npm install --legacy-peer-deps\` for a one-off install, or set \`legacy-peer-deps=true\` in \`.npmrc\` for the project. Root cause: npm v7\+ enforces strict peer-dependency resolution by default; a package declares a peer dependency on a version of React \(or another singleton\) that conflicts with what another package pulls in. \`--legacy-peer-deps\` restores npm v4–v6 behavior where peer conflicts are surfaced as warnings rather than hard failures.
Journey Context:
A developer clones a repo, runs \`npm install\`, and npm halts with ERESOLVE pointing at two packages that peer-depend on different React majors. They try deleting \`node\_modules\` and \`package-lock.json\` and reinstalling, but the conflict is structural. They inspect \`npm explain\` and see the diamond. They consider forcing a resolution with \`overrides\`, but that changes runtime semantics. They discover that npm switched to strict peer dependency enforcement in v7 \(the algorithm was rewritten\). Adding \`.npmrc\` with \`legacy-peer-deps=true\` lets the install complete and matches the behavior the project was originally developed against; the app still works because the peer conflict was historically only a warning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:20:15.479856+00:00— report_created — created