Every time I try to run npm install or any other npm command, a string of dependency errors pops up, leaving me puzzled on how to resolve them.
Here are the steps I've taken so far:-->
Forced update of angular CLI.
Reinstalled Node.
I even went as far as deleting the entire project once and cloning it again from the repository.
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4c2d2225212d382523223f0c7d7e627d627d">[email protected]</a> npm ERR! Found: @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1b7874697e5b2a2a3529352b">[email protected]</a> npm ERR! node_modules/@angular/core npm ERR! @angular/core@"~11.2.0" from the root project npm ERR! peer @angular/core@"11.2.0" from @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="583b3735353736186969766a7668">[email protected]</a> npm ERR! node_modules/@angular/common npm ERR! @angular/common@"~11.2.0" from the root project npm ERR! peer @angular/common@"11.2.0" from @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7c1a130e110f3c4d4d524e524c">[email protected]</a> npm ERR! node_modules/@angular/forms npm ERR! @angular/forms@"~11.2.0" from the root project npm ERR! 1 more (@ionic/angular) npm ERR! 5 more (@angular/platform-browser, ...) npm ERR! 7 more (@angular/forms, @angular/platform-browser, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/core@"12.1.1" from @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0a6b6463676b7e636564794a3b38243b243b">[email protected]</a> npm ERR! node_modules/@angular/animations npm ERR! @angular/animations@"^12.1.1" from the root project npm ERR! peer @angular/animations@">=12.0.0-0" from <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0a646d72277e786f646e4a3d243a243a">[email protected]</a> npm ERR! node_modules/ngx-trend npm ERR! ngx-trend@"^7.0.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="90f3ffe2f5d0a1a2bea1bea1">[email protected]</a> npm ERR! node_modules/@angular/core npm ERR! peer @angular/core@"12.1.1" from @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2c4d4245414d584543425f6c1d1e021d021d">[email protected]</a> npm ERR! node_modules/@angular/animations npm ERR! @angular/animations@"^12.1.1" from the root project npm ERR! peer @angular/animations@">=12.0.0-0" from <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1d737a6530696f7873795d2a332d332d">[email protected]</a> npm ERR! node_modules/ngx-trend npm ERR! ngx-trend@"^7.0.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!
Take a look at my package.json configuration below:
{
"name": "APP NAME",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"config": {
"ionic_generate_source_map": "true"
},
"private": true,
"dependencies": {
/* list of dependencies */
},
"devDependencies": {
/* list of devDependencies */
},
"description": "An Ionic project",
"cordova": {
/* cordova plugins and platforms */
}
}