npm install 抛出无法解决依赖项错误

问题描述 投票:0回答:1

我目前使用的是 Angular 版本 13。

当我尝试运行

npm install
命令时,出现以下错误。如何修复这些错误?

> npm install


npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"~13.0.0" from the root project
npm ERR!   peer @angular/common@">=6.1.0" from @angular-slider/[email protected]
npm ERR!   node_modules/@angular-slider/ngx-slider
npm ERR!     @angular-slider/ngx-slider@"^2.0.4" from the root project
npm ERR!   11 more (@angular/cdk, @angular/fire, @angular/flex-layout, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^11.2.14" from [email protected]
npm ERR! node_modules/angular-responsive-carousel
npm ERR!   angular-responsive-carousel@"^2.1.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@"^11.2.14" from [email protected]
npm ERR!   node_modules/angular-responsive-carousel
npm ERR!     angular-responsive-carousel@"^2.1.2" 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 npm
1个回答
0
投票

尝试命令

npm install --legacy-peer-deps

© www.soinside.com 2019 - 2024. All rights reserved.