1

I'm trying to add android to my Ionic proyect, but when I run the code, I have this issue:

Error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @angular-devkit/build-angular@15.2.6
npm ERR! Found: @angular/compiler-cli@10.2.5
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"^10.2.5" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler-cli@"^15.0.0" from @angular-devkit/build-angular@15.2.6  
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"^15.0.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/compiler-cli@15.2.9
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   peer @angular/compiler-cli@"^15.0.0" from @angular-devkit/build-angular@15.2.6
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"^15.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! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Usuario\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\Usuario\AppData\Local\npm-cache\_logs\2023-06-29T09_48_21_482Z-debug-0.log

package.json:

"dependencies": {
    "@angular/common": "^15.0.0",
    "@angular/core": "^15.0.0",
    "@angular/forms": "^15.0.0",
    "@angular/platform-browser": "^15.0.0",
    "@angular/platform-browser-dynamic": "^15.0.0",
    "@angular/router": "^15.0.0",
    "@awesome-cordova-plugins/calendar": "^6.3.0",
    "@capacitor/app": "4.1.1",
    "@capacitor/core": "4.7.3",
    "@capacitor/geolocation": "^5.0.2",
    "@capacitor/haptics": "4.1.0",
    "@capacitor/keyboard": "4.1.1",
    "@capacitor/status-bar": "4.1.1",
    "@fullcalendar/angular": "^6.1.7",
    "@fullcalendar/bootstrap5": "^6.1.7",
    "@fullcalendar/core": "^6.1.7",
    "@fullcalendar/daygrid": "^6.1.7",
    "@fullcalendar/interaction": "^6.1.7",
    "@fullcalendar/list": "^6.1.7",
    "@fullcalendar/timegrid": "^6.1.7",
    "@ionic/angular": "^7.0.2",
    "@ionic/vue": "^7.0.2",
    "@ionic/vue-router": "^7.0.2",
    "@swimlane/ngx-datatable": "^20.1.0",
    "bootstrap": "^5.2.3",
    "bootstrap-icons": "^1.10.5",
    "cordova-plugin-calendar": "^5.1.6",
    "install": "^0.13.0",
    "ionicons": "^7.0.0",
    "jquery": "^3.6.4",
    "npm": "^9.6.4",
    "rxjs": "~7.5.0",
    "swiper": "^9.2.3",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^15.0.0",
    "@angular-eslint/builder": "^15.0.0",
    "@angular-eslint/eslint-plugin": "^15.0.0",
    "@angular-eslint/eslint-plugin-template": "^15.0.0",
    "@angular-eslint/schematics": "^15.0.0",
    "@angular-eslint/template-parser": "^15.0.0",
    "@angular/cli": "^15.0.0",
    "@angular/compiler": "^15.0.0",
    "@angular/compiler-cli": "^10.2.5",
    "@angular/language-service": "^15.0.0",
    "@capacitor/cli": "4.7.3",
    "@ionic/angular-toolkit": "^9.0.0",
    "@types/jasmine": "~4.0.0",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "5.3.0",
    "@typescript-eslint/parser": "5.3.0",
    "eslint": "^7.6.0",
    "eslint-plugin-import": "^2.27.5",
    "eslint-plugin-jsdoc": "30.7.6",
    "eslint-plugin-prefer-arrow": "1.2.2",
    "jasmine-core": "~4.3.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "^1.1.2",
    "karma-coverage-istanbul-reporter": "^3.0.1",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",
    "ts-node": "~8.3.0",
    "typescript": "~4.8.4",
    "webpack": "^5.79.0",
    "webpack-cli": "^5.0.1"
  },
  "overrides": {
    "xml2js": "^0.5.0"
  }

I think the issue is that I have an old version of compiler-cli, but I tried to update, uninstall and install, and nothing works.

I tried to do all the thing that I saw on web, like update all the versions, or install --legacy-peer-deps, but none of this has succeed.

¿Any idea? Thanks.

Random
  • 3,158
  • 1
  • 15
  • 25

2 Answers2

1

SOLVED.

Al I have to do is update @angular-eslint/schematics and all the compiler dependencies are updated.

First I run ng update and then ng update @angular-eslint/schematics and all solved.

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
0

Your @angular/compiler-cli dependence is outdated (^10.2.5) it should be ^15.0.0

Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134