angular - 在角度 11 中安装 ng-bootstrap 时出错
问题描述
我已经安装了 Angular cli 的版本 (11),并且在安装 ng-bootstrap 时收到以下错误消息。有人可以帮我解决这个问题吗?
SeshagiiRaosMBP:trx-mngmt-ui-10 Munuma$ ng add @ng-bootstrap/ng-bootstrap
Unable to find compatible package. Using 'latest'.
Package has unmet peer dependencies. Adding the package may not succeed.
Installing packages for tooling via npm.
An unhandled exception occurred: npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: trx-mngmt-ui@0.0.0
npm ERR! Found: @angular/core@11.0.5
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"~11.0.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"10.0.14" from @angular/common@10.0.14
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"~10.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 /Users/Munuma/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Munuma/.npm/_logs/2020-12-29T14_49_36_751Z-debug.log
Package install failed, see above.
See "/private/var/folders/m1/g43nd64x54qdm_94_wk1sc7m0000gn/T/ng-fL8ZaZ/angular-errors.log" for further details.
解决方案
运行npm i @ng-bootstrap/ng-bootstrap --legacy-peer-deps
解决问题
推荐阅读
- java - 如何在 android studio java 中使用 OkHttpClient 发布多个图像?
- r - R基于双字符分隔符分割字符串
- python - 在 Python numpy 中计算两个二维数组的不同非零值
- java - 如何将具有数组的 JSON 转换为 Java 对象
- google-sheets - 如何在 google 表格中编写宏以刷新 bigquery 数据连接器?
- c++ - inotify 是一次性解决方案吗
- magento - whatsapp 分享链接 url 甚至没有显示描述和缩略图 magento 1.9
- javascript - 如何在 php 中调整保证金会话闪存?
- webpack - dotenv-webpack 在 webpack.config.js 中使用环境变量
- answer-set-programming - 如何告诉我的图形着色问题程序只分配一次颜色 1?