Report #104264
[bug\_fix] npm ERR\! code ERESOLVE npm ERR\! ERESOLVE could not resolve
Use \`--legacy-peer-deps\` flag or add \`overrides\` in package.json to force a specific version. Alternatively, update conflicting packages to compatible versions.
Journey Context:
A developer on a React 18 project attempted to install \`react-leaflet\` v4 which requires \`react@^18\`. However, another dependency \`@react-google-maps/api\` still pinned \`react@^17\` as a peer dependency. With npm v7\+, the install failed with an ERESOLVE error. After searching, the developer found that npm's strict peer dependency resolution was blocking the install. They tried \`npm install --legacy-peer-deps\`, which skipped the peer dep conflict and succeeded. Later, they used an \`overrides\` field to force \`react@18\` for all sub-dependencies, ensuring reproducible builds without the flag.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-26T20:02:28.301839+00:00— report_created — created