ESLint Peer Dependency Conflict - Fix ERESOLVE on Install in CI
By Daniel Zoghalchali·Latchkey
npm could not satisfy ESLint's peer dependencies: a plugin or shareable config declares a peer eslint range that does not include the ESLint version you are installing. Common around the ESLint 8→9 / flat-config transition.
What this error means
npm ci/npm install fails with ERESOLVE could not resolve, showing a plugin's peer eslint@"^8" against your eslint@9. It fails at install time, before ESLint ever runs.
npm output
npm error code ERESOLVE
npm error While resolving: eslint-plugin-legacy@1.2.0
npm error Found: eslint@9.4.0
npm error Could not resolve dependency:
npm error peer eslint@"^8.0.0" from eslint-plugin-legacy@1.2.0
Diagnose it: config resolution and version drift
Lint failures that appear only in CI are almost always a different linter version or a different resolved configuration, not new violations in the code.
A plugin pins peer eslint@^8 while you install ESLint 9. Until the plugin ships a v9-compatible release, the peer cannot be satisfied.
Mixed ESLint majors across the toolchain
Some packages expect ESLint 8 (legacy .eslintrc) and others ESLint 9 (flat config). The peer ranges do not overlap.
How to fix it
Upgrade plugins to ESLint-compatible releases
Move every ESLint plugin/config to a version whose peer range includes your ESLint.
Terminal
npm install -D eslint@latest eslint-plugin-react@latest \
@typescript-eslint/eslint-plugin@latest
npm ci # confirm ERESOLVE is gone
Pin a consistent ESLint major if a plugin lags
If a critical plugin has no v9 release yet, stay on ESLint 8 across the toolchain rather than forcing the install.
Terminal
# prefer aligning versions over masking the conflict:
npm install -D eslint@^8
# avoid --force / --legacy-peer-deps, which install an unsupported combo
How to prevent it
Upgrade ESLint and all plugins/configs together across a major bump.
Check each plugin's peer eslint range before bumping ESLint.
Avoid --force/--legacy-peer-deps as a standing fix.
Frequently asked questions
What causes ESLint peer dependency conflict?
There are 2 common causes: plugin/config not updated for the eslint major and mixed eslint majors across the toolchain. A plugin pins peer eslint@^8 while you install ESLint 9.
How do I fix ESLint peer dependency conflict?
There are 2 fixes depending on which cause you have: upgrade plugins to eslint-compatible releases and pin a consistent eslint major if a plugin lags. Work through them in order, since the first is the most common.
What does ESLint peer dependency conflict actually mean?
npm ci/npm install fails with ERESOLVE could not resolve, showing a plugin's peer eslint@"^8" against your eslint@9.
How do I stop ESLint peer dependency conflict happening again?
Upgrade ESLint and all plugins/configs together across a major bump. The prevention section lists 3 changes that keep it from recurring.