- Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: youtube@0.0.0
npm ERR! Found: @angular/compiler-cli@12.2.0-next.1
npm ERR! node_modules/@angular/compiler-cli
npm ERR! dev @angular/compiler-cli@"~12.2.0-next.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler-cli@"^12.0.0 || ^12.1.0-next" from @angular-devkit/build-angular@12.2.0-next.0
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~12.2.0-next.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.
npm ERR!
npm ERR! See C:\Users\Politics17\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Politics17\AppData\Local\npm-cache\_logs\2021-07-02T05_47_00_003Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
Asked
Active
Viewed 411 times
0

jonrsharpe
- 115,751
- 26
- 228
- 437
-
2did you try the command along with --force or --legacy-peer-deps ? – Harikrishnan S Jul 01 '21 at 17:19
2 Answers
1
I had this issue when updating my node version to 12. The solution was run:
npm i --legacy-peer-deps
If you don't want to run npm i --legacy-peer-deps
every time, you can add legacy-peer-deps=true
in your npm configuration file (.npmrc in the project root, if it doesn't exist you can create it).
Information about legacy-peer-deps

Alan De Renzis
- 136
- 3
0
Use this command:
npm install --save --legacy-peer-deps
This can also be set more permanently as a configuration option like this:
npm config set legacy-peer-deps true
However, if above approach does not work try removing the node_modules
folder and package-lock.json
file and then run this command:
npm install

Salahuddin Ahmed
- 4,854
- 4
- 14
- 35