Report #97142
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Use the legacy peer-deps resolver by running \`npm install --legacy-peer-deps\`, or switch to a compatible version of the dependency that satisfies the peer-constraint range. If the project uses npm workspaces, pin the conflicting peer dependency to a single version at the workspace root. Do not delete package-lock.json and reinstall blindly; the conflict is real and will recur.
Journey Context:
You run \`npm install some-lib@latest\` and the installer halts with ERESOLVE, pointing at two packages that demand incompatible versions of React. At first it looks like npm is broken, because the same install worked last month. You try deleting \`node\_modules\` and \`package-lock.json\`, but the error returns. Digging into the tree, you notice \`some-lib\` declares \`peerDependencies: \{ "react": "^18.0.0" \}\` while another package in your tree still declares \`react: "^17.0.0"\`. npm v7\+ enforces peer dependencies strictly by default, whereas npm v6 silently ignored mismatches. The legacy flag tells npm to use the v6 peer-dependency resolution behavior, allowing the install to proceed while you plan the upgrade. Alternatively, you upgrade the older package so both peer ranges overlap.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:37:27.289038+00:00— report_created — created