Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

While installing Bootstrap 4 (the latest beta version) with NPM : `npm install [email protected], I got this message :

+-- [email protected]
+-- [email protected]
+-- UNMET PEER DEPENDENCY jquery@>=3.0.0
`-- UNMET PEER DEPENDENCY popper.js@^1.11.0

npm WARN [email protected] requires a peer of jquery@>=3.0.0 but none was installed.
npm WARN [email protected] requires a peer of popper.js@^1.11.0 but none was installed.
npm WARN [email protected] No repository field.

To remove this warning : npm i --save jquery popper.js

But, why the first command didn't install Bootstrap 4, Jquery and Popper.js in one time? normally NPM should install dependencies !!

Any explaination please?

Thank you

like image 340
MDIT Avatar asked Sep 25 '17 08:09

MDIT


2 Answers

The problem was reported to the Bootstrap development team in this issue. In principle, Bootstrap 4 can be used without jQuery and Popper, but these two optional packages are considered as peer dependencies in the [email protected] version installed with npm.

According to the comments made by the Bootstrap developers in the discussion, they are going to offer two different Bootstrap packages:

  • bootstrap-css: which will not have any dependency on jQuery and Popper
  • bootstrap: which, I assume, will install the required dependencies
like image 83
ConnorsFan Avatar answered Sep 28 '22 06:09

ConnorsFan


All depend of the configuration of the package.json from the npm package. 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.

If you want to know more about peerDependecies this is the link: https://docs.npmjs.com/files/package.json#peerdependencies

like image 25
Julio Guerra Avatar answered Sep 28 '22 04:09

Julio Guerra