ng-bootstrap 依赖项和警告
ng-bootstrap dependancies and warning
我希望使用 ng-bootstrap.
文档要求安装 bootstrap CSS 作为依赖项,但不包括 jQuery
如果我使用 npm 安装 bootstrap,我会收到警告,它需要 jquery 和 popper。
$ npm i -S bootstrap
npm WARN bootstrap@4.1.3 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.1.3 requires a peer of popper.js@^1.14.3 but none is installed. You must install peer dependencies yourself.
有没有办法在我的项目中安装 bootstrap css 而无需添加不需要的对等依赖项?
jQuery/popper 上缺少对等依赖项警告此时是正常的。这个警告的原因是ng-bootstrap只需要BootstrapCSS。它不需要 Bootstrap JS 及其依赖项 (popper.js)。
不幸的是,我们无法摆脱这个警告,因为 Bootstrap 不会 发布只有 CSS 的包。安装 Bootstrap CSS 的唯一方法是安装将对等依赖项设置为 jQuery / popper.
的整个软件包
长话短说:此警告是预料之中的,但存在技术限制,我们无法摆脱它。你不需要 jQuery / popper 来使用 ng-bootstrap 并且你不应该手动安装它们。此时您还应该忽略缺少对等依赖项警告。
只需在 Window 中尝试:
npm install --save @ng-bootstrap/ng-bootstrap
只需在 Linux 中尝试:
sudo npm install --save @ng-bootstrap/ng-bootstrap
我希望使用 ng-bootstrap.
文档要求安装 bootstrap CSS 作为依赖项,但不包括 jQuery
如果我使用 npm 安装 bootstrap,我会收到警告,它需要 jquery 和 popper。
$ npm i -S bootstrap
npm WARN bootstrap@4.1.3 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.1.3 requires a peer of popper.js@^1.14.3 but none is installed. You must install peer dependencies yourself.
有没有办法在我的项目中安装 bootstrap css 而无需添加不需要的对等依赖项?
jQuery/popper 上缺少对等依赖项警告此时是正常的。这个警告的原因是ng-bootstrap只需要BootstrapCSS。它不需要 Bootstrap JS 及其依赖项 (popper.js)。
不幸的是,我们无法摆脱这个警告,因为 Bootstrap 不会 发布只有 CSS 的包。安装 Bootstrap CSS 的唯一方法是安装将对等依赖项设置为 jQuery / popper.
的整个软件包长话短说:此警告是预料之中的,但存在技术限制,我们无法摆脱它。你不需要 jQuery / popper 来使用 ng-bootstrap 并且你不应该手动安装它们。此时您还应该忽略缺少对等依赖项警告。
只需在 Window 中尝试:
npm install --save @ng-bootstrap/ng-bootstrap
只需在 Linux 中尝试:
sudo npm install --save @ng-bootstrap/ng-bootstrap