PlainError

Home / Coding

npm ERR! code ERESOLVE unable to resolve dependency tree

Last checked 2026-10-17 · 3 fixes · reviewed answer

TL;DRThis error occurs when the npm package manager cannot install the required software packages because different packages demand conflicting versions of the same supporting library.

Likely causes

  1. Conflicting version requirements listed in the project's package.json or its dependenciesmost likely
  2. Newer npm versions enforcing stricter dependency rules that older projects do not meetpossible
  3. One or more packages being outdated and no longer compatible with each otherless likely

How to fix it

Safest first: SafeChanges settingsDangerous
  1. View the package.json file to inspect current dependenciesSafe

    Open the project folder and look at the package.json file to see which packages are listed.

    cat package.json
  2. Update packages to compatible versionsSafe

    Use npm to check for and apply updates that may resolve conflicts.

    npm outdated
  3. Try installing with legacy peer dependency flagChanges settings

    Run the install command again while allowing older-style dependency resolution.

    npm install --legacy-peer-deps

If that didn't fix it

If the error remains, manually adjust version numbers in package.json or delete the node_modules folder and package-lock.json then retry install.

When to see a technician

Consult a developer experienced with Node.js projects if editing dependency files feels unsafe.

Did this fix it? Report a problem

Related errors