简体   繁体   English

UNMET PEER DEPENDENCY jquery @> = 3.0.0&popper.js@^1.11.0

[英]UNMET PEER DEPENDENCY jquery@>=3.0.0 & popper.js@^1.11.0

While installing Bootstrap 4 (the latest beta version) with NPM : `npm install bootstrap@4.0.0-beta, I got this message : 在使用NPM安装Bootstrap 4(最新测试版)时:`npm install bootstrap@4.0.0-beta,我收到此消息:

+-- bootstrap@4.0.0-beta
+-- font-awesome@4.7.0
+-- UNMET PEER DEPENDENCY jquery@>=3.0.0
`-- UNMET PEER DEPENDENCY popper.js@^1.11.0

npm WARN bootstrap@4.0.0-beta requires a peer of jquery@>=3.0.0 but none was installed.
npm WARN bootstrap@4.0.0-beta requires a peer of popper.js@^1.11.0 but none was installed.
npm WARN b4starter@1.0.0 No repository field.

To remove this warning : npm i --save jquery popper.js 要删除此警告: npm i --save jquery popper.js

But, why the first command didn't install Bootstrap 4, Jquery and Popper.js in one time? 但是,为什么第一个命令没有一次安装Bootstrap 4,Jquery和Popper.js? normally NPM should install dependencies !! 通常NPM应该安装依赖!!

Any explaination please? 有解释吗?

Thank you 谢谢

The problem was reported to the Bootstrap development team in this issue . 本期中向Bootstrap开发团队报告了该问题 In principle, Bootstrap 4 can be used without jQuery and Popper , but these two optional packages are considered as peer dependencies in the bootstrap@4.0.0-beta version installed with npm. 原则上,Bootstrap 4可以在没有jQuery和Popper的情况下使用,但这两个可选包在与npm一起安装的bootstrap@4.0.0-beta版本中被视为对等依赖项。

According to the comments made by the Bootstrap developers in the discussion, they are going to offer two different Bootstrap packages: 根据Bootstrap开发人员在讨论中提出的意见,他们将提供两种不同的Bootstrap包:

  • bootstrap-css: which will not have any dependency on jQuery and Popper bootstrap-css:它不依赖于jQuery和Popper
  • bootstrap: which, I assume, will install the required dependencies bootstrap:我认为,它将安装所需的依赖项

All depend of the configuration of the package.json from the npm package. 全部取决于npm包中package.json的配置。 if you check the respository for bootstrap here , you can see this: 如果您在这里检查存储库的引导程序 ,您可以看到:

...
"dependencies": {},
"peerDependencies": {
 "jquery": "^3.0.0",
 "popper.js": "^1.12.3"
},
...

When you install a npm package, just the dependencies specified in package.json file as dependencies would be download with the package. 安装npm软件包时,只需将package.json文件中指定的依赖项作为依赖项下载。

If you want to know more about peerDependecies this is the link: https://docs.npmjs.com/files/package.json#peerdependencies 如果您想了解有关peerDependecies更多信息,请peerDependecies以下链接: httpspeerDependecies

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM