Report #10964
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Run npm install with --legacy-peer-deps, or manually align the conflicting peer dependency versions in package.json to satisfy the strict constraint.
Journey Context:
Developer upgrades Node.js to v15\+ \(bundled with npm 7\) and clones a legacy React project. Running npm install triggers ERESOLVE, showing that react-scripts requires react@^17.0.0 but the project uses [email protected]. The developer tries deleting node\_modules and package-lock.json, but the error persists. They realize npm 7\+ automatically installs peer dependencies and enforces strict resolution. Checking the npm documentation, they discover npm 6 was lenient while npm 7 is strict. Instead of forcing with --force \(which can corrupt the tree\), they use --legacy-peer-deps to temporarily revert to npm 6 behavior, allowing the install to complete while they plan the React 18 migration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:11:49.191961+00:00— report_created — created