close

[Solved] Unable to resolve dependency tree error for creating new angular project

Hello Guys, How are you all? Hope You all Are Fine. Today When I Create new project Angular I get the following Error Unable to resolve dependency tree . So Here I am Explain to you all the possible solutions here.

Without Wasting your time, Lets start This Article to Solve This Error.

How Unable to resolve dependency tree Error Occurs ?

I was trying to create new project in Angular by ng new YiloYilo Command. and I got this error:

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/jasmine-core
npm ERR!   dev [email protected]"~3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer [email protected]">=3.7.1" from [email protected]
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR!   dev [email protected]"^1.5.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I don’t know how this error occurs.

How To Solve Unable to resolve dependency tree Error ?

Question: How To Solve Unable to resolve dependency tree Error ?
Answer: The problem is jasmine-core and karma-jasmine-html-reporter version is throwing error. So the solution is to change the version of “jasmine-core” 3.6.0 to 3.7.1 and “karma-jasmine-html-reporter” from 1.5.0 to 1.6.0 and save it.

Solution 1

The problem is jasmine-core and karma-jasmine-html-reporter version is throwing error. So the solution is to change the version of “jasmine-core” 3.6.0 to 3.7.1 and “karma-jasmine-html-reporter” from 1.5.0 to 1.6.0 and save it. follow the below steps.

  1. Open the project Folder.
  2. Now, open the package.json file.
  3. In devDependencies change the version of below both Dependencies.
  4. Change the version of “jasmine-core” 3.6.0 to 3.7.1
  5. “karma-jasmine-html-reporter” from 1.5.0 to 1.6.0 
  6. Save this package.json file.
  7. Open terminal in project.
  8. run npm install
  9. Now it works und you can run ng serve.

Solution worked for me. Comment below which solution worked for you too ?

Solution 2

Maybe the issue with latest NPM 7.12.0 and the latest Node 16.1.0.

I followed the below steps –

  • Uninstall Node
  • Re-Install the Latest Node (LTS: 14.16.1)
  • Run the ng new my-app

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also Read

1 thought on “[Solved] Unable to resolve dependency tree error for creating new angular project”

  1. Thank you, appreciate the resolution. I just encounter the exact same thing, follow your instructions and run my app, and it works.

    Reply

Leave a Comment