Skip to content
Home » npm ERR! ERESOLVE unable to resolve dependency tree while installing npm Packages

npm ERR! ERESOLVE unable to resolve dependency tree while installing npm Packages

To solve npm ERR! ERESOLVE unable to resolve dependency tree while installing npm Packages error follow below methods.

ERROR LOG

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: project-admin@11.0.0
npm ERR! Found: @angular/common@11.0.3
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"11.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^9.1.0 || ^10.0.0" from @agm/core@3.0.0-beta.0
npm ERR! node_modules/@agm/core
npm ERR!   @agm/core@"3.0.0-beta.0" from the root project

How to solve npm ERR! ERESOLVE unable to resolve dependency tree ?

This has nothing to do with an HTTP proxy.

As it states, you have a dependence conflict (incorrect and potentially broken dependency), so try running the command with –force or –legacy-peer-deps. If it does not take effect, the temporary remedy is to utilize previous versions of Node.js (downgrade the Node.js version), as this type of problem occurs from time to time.

Try this command-

npm install --save --legacy-peer-deps

In addition to using the –legacy-peer-deps command line option, this can also be specified more permanently via a config option:

npm config set legacy-peer-deps true

Alternative to Fix ERESOLVE unable to resolve dependency tree while installing npm packages

This occurs frequently when using npm 7, because peer dependency issues are recognized as failures in version 7, whereas they were generally merely warnings in version 6. It usually works with npm 7 if you use --legacy-peer-deps.

If that doesn’t work, you can downgrade to npm 6. It is not essential to downgrade Node.js (but not harmful either). npm contains the necessary dependency management code. Downgrading Node.js will frequently work accidentally since it will frequently downgrade npm as well.

Another less disruptive method than downgrading npm is to use npx to utilise the old version of npm only for the install command: npx -p npm@6 npm install

When all else fails, it’s generally worth a try to delete the node modules directory and package-lock.json, then rerun npm install. Node modules and package-lock.json are regenerated as a result.

Hope the above solution works.

Also read :

Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Your facebook account’s off-Facebook activty in turned off