我试图将Android添加到我的Ionic项目中,但当我运行代码时,我遇到了这个问题:
错误:
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"
}
型
我认为问题是我有一个旧版本的compiler-cli,但我试图更新,卸载和安装,没有任何工作。
我试着做我在网上看到的所有事情,比如更新所有的版本,或者安装--legacy-peer-deps,但这些都没有成功。
有什么想法吗谢谢。
2条答案
按热度按时间aoyhnmkz1#
解决了。
我所要做的就是更新
@angular-eslint/schematics
,所有的编译器依赖关系都被更新了。首先运行
ng update
,然后运行ng update @angular-eslint/schematics
,所有问题都解决了。cuxqih212#
您的
@angular/compiler-cli
依赖项已过时(^10.2.5
),应该是^15.0.0