Report #6089
[bug\_fix] npm ERR\! code ERESOLVE could not resolve dependency tree
Use --legacy-peer-deps flag or align peer dependency versions in package.json using overrides
Journey Context:
Upgraded from Node 14/npm 6 to Node 18/npm 8. Ran npm install on an existing Next.js project that previously worked. npm now throws ERESOLVE citing a conflict between [email protected] and [email protected] required by different packages. Deleted node\_modules and package-lock.json, same error. Realized npm 7\+ automatically installs peer dependencies by default, creating stricter resolution. The --legacy-peer-deps flag restores npm 6 behavior, allowing the install to proceed. Permanent fix involves updating packages or using npm overrides to force a single React version.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:10:10.950325+00:00— report_created — created