Report #60739
[bug\_fix] npm ERR\! ERESOLVE could not resolve
Run npm install with --legacy-peer-deps flag, or downgrade to npm 6, or upgrade conflicting dependencies to compatible peer ranges.
Journey Context:
Developer upgrades from Node 14/npm 6 to Node 18/npm 8 and runs npm install on an existing React project. The install crashes with ERESOLVE indicating that package X requires React 17 while package Y requires React 18 as peer dependencies. Developer deletes node\_modules and package-lock.json and retries, but npm 7\+'s strict peer dependency resolution still fails because it automatically installs peers and enforces version matching. After searching the error code, developer realizes npm 7\+ changed peer dependency handling per RFC 25. Using --legacy-peer-deps restores the npm 6 behavior of ignoring peer conflicts during install, allowing the legacy project to install while acknowledging potential runtime warnings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:26:25.940161+00:00— report_created — created