无法在 Angular cli 13.0.3 中安装 @angular/flex-layout
Posted
技术标签:
【中文标题】无法在 Angular cli 13.0.3 中安装 @angular/flex-layout【英文标题】:Cannot install @angular/flex-layout in Angular cli 13.0.3 【发布时间】:2022-01-02 12:35:27 【问题描述】:我尝试安装 angular flex 布局,但它一直抛出此错误。有人可以帮我解决这个错误
> (base) rajkirito@rajkirito-Vostro-15-3568:~/Web development/Angular/conFusion$ npm install @angular/flex-layout --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: con-fusion@0.0.0
npm ERR! Found: @angular/cdk@13.0.2
npm ERR! node_modules/@angular/cdk
npm ERR! @angular/cdk@"^13.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/cdk@"^12.0.0" from @angular/flex-layout@12.0.0-beta.35
npm ERR! node_modules/@angular/flex-layout
npm ERR! @angular/flex-layout@"*" 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 /home/rajkirito/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/rajkirito/.npm/_logs/2021-11-24T04_18_03_524Z-debug.log
【问题讨论】:
【参考方案1】:此时您需要 --force
选项才能将其与 Angular 13 一起使用。
详情见here。
【讨论】:
以上是关于无法在 Angular cli 13.0.3 中安装 @angular/flex-layout的主要内容,如果未能解决你的问题,请参考以下文章
使用 Angular-cli 在 Angular 2 应用程序中安装 bootstrap-material-design
在 Angular CLI 应用程序中安装 express 时出现“ENOTEMPTY:目录不为空,rmdir .....”错误。