我刚刚开始一个新的角材料项目。它失败了,错误如下
moblizeit@Vikrams-MBP scanbuddyadmin % ng add @angular/fire@latest
ℹ Using package manager: npm
⚠ Package has unmet peer dependencies. Adding the package may not succeed.
The package @angular/fire@latest will be installed and executed.
Would you like to proceed? Yes
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: scanbuddyadmin@0.0.0
npm ERR! Found: @angular/common@16.0.2
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"^16.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0" from @angular/fire@7.5.0
npm ERR! node_modules/@angular/fire
npm ERR! @angular/fire@"7.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.
npm ERR!
npm ERR! See /Users/moblizeit/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/moblizeit/.npm/_logs/2023-05-21T03_28_48_338Z-debug-0.log
✖ Packages installation failed, see above.
package.json看起来如下所示
{
"name": "scanbuddyadmin",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^16.0.0",
"@angular/cdk": "^16.0.1",
"@angular/common": "^16.0.0",
"@angular/compiler": "^16.0.0",
"@angular/core": "^16.0.0",
"@angular/fire": "^0.0.0",
"@angular/forms": "^16.0.0",
"@angular/material": "^16.0.1",
"@angular/platform-browser": "^16.0.0",
"@angular/platform-browser-dynamic": "^16.0.0",
"@angular/router": "^16.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.0.2",
"@angular/cli": "~16.0.2",
"@angular/compiler-cli": "^16.0.0",
"@types/jasmine": "~4.3.0",
"jasmine-core": "~4.6.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~5.0.2"
}
}
我不知道怎么解决?
1条答案
按热度按时间juud5qan1#
@angular/fire@"7.5.0"
想要12-15的Angular 版本,但你的Angular 版本是16。但是你可以用--legacy-peer-deps
来添加它。