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: project-name@0.0.0
npm ERR! Found: jasmine-core@3.6.0
npm ERR! node_modules/jasmine-core
npm ERR! dev jasmine-core@"~3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core@">=3.7.1" from karma-jasmine-html-reporter@1.6.0
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR! dev karma-jasmine-html-reporter@"^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.
- Open the project Folder.
- Now, open the package.json file.
- In devDependencies change the version of below both Dependencies.
- Change the version of “jasmine-core” 3.6.0 to 3.7.1
- “karma-jasmine-html-reporter” from 1.5.0 to 1.6.0
- Save this package.json file.
- Open terminal in project.
- run npm install
- 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
Thank you, appreciate the resolution. I just encounter the exact same thing, follow your instructions and run my app, and it works.
Thank you very much, I followed your instructions and I finally executed the project.
Thanks Buddy, It help me to resolve my issue.
It’s my Pleasure to Help You Abdul. Thank You For Your Valuable words.