Report #79823
[bug\_fix] npm ERR\! code ERESOLVE
Pass --legacy-peer-deps to npm install, or downgrade to npm 6. Root cause: npm 7\+ uses @npmcli/arborist which strictly validates peer dependency trees, rejecting historically tolerated mismatches that were silently ignored in npm 6.
Journey Context:
Developer upgrades to Node.js 16/18 which bundles npm 7\+. Running npm install on an existing project immediately throws ERESOLVE with 'could not resolve dependency tree' and 'Fix the upstream dependency conflict'. Developer deletes node\_modules and package-lock.json thinking it's corruption, but the error persists. Searching reveals npm 7 introduced strict peer dependency resolution. Developer tries --force which works but is unsafe, then discovers --legacy-peer-deps restores npm 6 behavior, allowing the install to complete while they plan to properly fix peer conflicts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:34:42.637442+00:00— report_created — created