unable to resolve dependency tree error for creating new angular project
Open the folder you create with ng new and open the package.json
file. In devDependencies
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. Then go back to Terminal and go to your project and run npm install
. Now it works and you can run ng serve
.
Mine is a temporary solution for angular-cli v11.2.12 based on @david-Öztürk answer and on this angular-cli github issue discussions and on its merged fix.
By executing the steps listed on @david-Öztürk answer I was still getting the same error. And also the fix is more conservative than the proposed solution. I hope it helps someone else:
Run the Angular project creation without automatic npm packages installation:
ng new --skip-install <project-name>
Enter project directory:
cd <project-name>
Edit package.json
and change this...
"karma-jasmine-html-reporter": "^1.5.0",
...to this:
"karma-jasmine-html-reporter": "~1.5.0",
Manually install npm packages:
npm install