PlainError

npm ERR! code ERESOLVE

Last checked 2026-11-20 · 3 fixes · AI-drafted, auto-reviewed · how we write fixes

TL;DRnpm failed to install packages because it could not resolve conflicting dependencies, usually peer dependency mismatches introduced in npm 7 and later.

Most likely cause: Peer dependency version conflicts between packages listed in package.json

Try first: Check current dependency tree for conflicts (npm ls)

Likely causes

  1. Peer dependency version conflicts between packages listed in package.jsonmost likely
  2. Outdated or incompatible packages in node_modules or package-lock.jsonpossible
  3. Strict dependency resolution rules in newer npm versionspossible

How to fix it

Safest first: SafeChanges settingsDangerous
  1. Check current dependency tree for conflictsSafe

    Run this read-only command in your project folder to list what is conflicting.

    npm ls
  2. Install with legacy peer dependency flagChanges settings

    Add the flag that tells npm to use the older, less strict resolution behavior.

    npm install --legacy-peer-deps
  3. Clean install after removing lock fileDangerous

    Delete node_modules and package-lock.json then reinstall. This can lose local changes so back up first.

    rm -rf node_modules package-lock.json && npm install

    ⚠ Back up your project folder before running this command.

If that didn't fix it

Run npm install with the --force flag and note any new error messages.

When to see a technician

If the project has many interdependent packages or you are not comfortable editing package.json, ask a Node.js developer for help.

Did this fix it? Report a problem

Related errors

All Coding errors →