ESLint Peer Dependency Conflict - Fix ERESOLVE on Install in CI
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 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.0Common causes
Plugin/config not updated for the ESLint major
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.
npm install -D eslint@latest eslint-plugin-react@latest \
@typescript-eslint/eslint-plugin@latest
npm ci # confirm ERESOLVE is gonePin 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.
# prefer aligning versions over masking the conflict:
npm install -D eslint@^8
# avoid --force / --legacy-peer-deps, which install an unsupported comboHow to prevent it
- Upgrade ESLint and all plugins/configs together across a major bump.
- Check each plugin's peer
eslintrange before bumping ESLint. - Avoid
--force/--legacy-peer-depsas a standing fix.