[英]Angular Dependency Issue with ngx-favicon
有人可以向我解釋為什么我不能使用npm install ngx-favicon
嗎?
npm install ngx-favicon
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: online-booking-portal@0.0.0
npm ERR! Found: @angular/common@14.0.7
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"~14.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^13.0.0" from ngx-favicon@4.0.1
npm ERR! node_modules/ngx-favicon
npm ERR! ngx-favicon@"*" 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.
這些是安裝的 Angular 版本:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 14.2.10
Node: 16.14.2
Package Manager: npm 9.1.2
OS: win32 x64
Angular: 14.0.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1402.10
@angular-devkit/build-angular 14.2.10
@angular-devkit/core 14.2.10
@angular-devkit/schematics 14.2.10
@angular/cli 14.2.10
@schematics/angular 14.2.10
rxjs 7.5.7
typescript 4.7.3
我的理解是 ngx-favicon 的 4.0.1 正在尋找 @angular/common 的至少 13.0.0 版本(^13.0.0 部分)。
存在依賴性不匹配。
[^version] 表示Compatible with version 。
在上面的錯誤ngx-favicon@4.0.1
requires @angular/common
version @^13.0.0
而實際的@angular/common
version is @14.0.7
在這種情況下, @ngx-favicon
與版本兼容<14.0.0
使用選項--legacy-peer-deps
安裝 package 忽略沖突。
npm install ngx-favicon --legacy-peer-deps
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.