Report #44727
[bug\_fix] ERESOLVE unable to resolve dependency tree
Use \`npm install --legacy-peer-deps\` to restore npm 6.x behavior, or \`--force\` to skip resolution validation. Root cause: npm 7\+ \(Arborist\) enforces strict peer dependency resolution by automatically installing peers, causing conflicts when multiple packages depend on incompatible peer ranges \(e.g., React 17 vs 18\).
Journey Context:
Developer clones a legacy React project from 2020 and runs \`npm install\` with Node 18/npm 9. Instead of installing, npm dumps a massive ERESOLVE error tree showing \`react@^17.0.0\` conflicts with \`react@^18.0.0\` required by a sub-dependency. Developer tries \`rm -rf node\_modules package-lock.json\` three times, but the error persists because the conflict is in the logical tree, not the filesystem. After searching the error code, they find npm's blog post about Arborist. They try \`npm install --legacy-peer-deps\`, which succeeds instantly because it disables the automatic peer dependency installation that was causing the version collision.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:32:25.909962+00:00— report_created — created