如何为 Angular 11 安装 ngx-bootstrap v7.0.0?

How to install ngx-bootstrap v7.0.0 for Angular 11?

我在我的 Angular 8 项目中使用 ngx-bootstrap 5.x.x 但现在我已经将我的 Angular v8 迁移到 v11 并且我开始面临下拉菜单的问题.它不会在第一次点击时打开。我发现他们被推荐使用 v7.0.0 但是当我使用

安装它时
npm i ngx-bootstrap@7.0.0 --save

它抛出一个错误

npm ERR! code ETARGET
npm ERR! notarget No matching version found for ngx-bootstrap@7.0.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

任何帮助将不胜感激!

既然7.0.0是Release candidate版本,你应该提到-rc和version。它变成 npm i ngx-bootstrap@7.0.0-rc.1 你可以看到来自 here.

的安装命令

它已准备好发布,但尚未经过验证,因此尚未准备好标记为稳定版本。您可以将其视为成熟的测试版。更多详情,您可以访问wikipedia

可以查看npm官方CDNlink,最新版本是6.2.0。因为 npm CDN 没有可用的 7.0 版本来解释这个问题。如果要强制安装尚未发布且在队列中的版本,请使用

npm i ngx-bootstrap@7.0.0-rc.1

您可以访问此了解更多信息

www.npmjs.com