Report #27045
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Run npm install with --legacy-peer-deps flag, or manually align conflicting peer dependency versions in package.json to satisfy the strict constraint.
Journey Context:
You are upgrading a React application from version 17 to 18. After updating the react and react-dom entries in package.json, you run npm install. The installation halts with ERESOLVE errors citing that react-virtualized has a peer dependency on react@^16.0.0 \|\| ^17.0.0 but you have [email protected]. npm 7 and later enforce peer dependency constraints strictly by default, treating version conflicts as fatal errors rather than warnings. You check npm --version and see 8.x. You try npm ls to visualize the tree, confirming the conflict. Realizing you cannot immediately upgrade the legacy library due to breaking changes, you re-run the install with --legacy-peer-deps, which restores the npm 6 behavior of allowing peer dependency conflicts while issuing warnings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:47:31.554913+00:00— report_created — created