Sayandeep Majumdar
Sayandeep Majumdar

Reputation: 484

Fix the upstream dependency conflict while creating new angular project

Version:
Angular CLI: 12.1.1
Node: 14.17.3
Package Manager: npm 7.19.1

Error coming while creating a new angular project.

npm ERR! code ERESOLVE
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 jasmine-core@"~3.7.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core@">=3.8" from [email protected]
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.

After searching StackOverflow I found this and tried.

  1. Run the command with --force, or --legacy-peer-deps
  2. npm uninstall –g @angular/CLI
    npm cache clean --force
    npm install –g @angular/cli@latest

But still didn't resolve the issue. TIA

Upvotes: 3

Views: 10321

Answers (3)

Barry Connolly
Barry Connolly

Reputation: 663

I found this worked

npm audit fix --force 

Then try again

Upvotes: 1

Sayandeep Majumdar
Sayandeep Majumdar

Reputation: 484

Solved

npm version 7 has some issues. I have downgraded the npm version to 6. It's running now.

Upvotes: 0

Adraah
Adraah

Reputation: 11

I solved it downgrading my node and npm versions, it seems that the problem is with npm 7.

Angular CLI: 12.1.1
Node: 14.16.1
Package Manager: npm 6.14.12

Upvotes: 1

Related Questions