How to install popper.js using Bootstrap 4?

From what I've read so far, popper.js is a big problem with Bootstrap 4. I can't get it to work. I keep getting this error:

Error: Popper.js ( https://popper.js.org ) is required for the bootstrap dropdown list

I tried installing CDN and NPM. The same result. At the bottom of my HTML file, I have this for installing NPM:

<script src="js/jquery.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/tether.min.js"></script>
<script src="js/bootstrap.min.js"></script>

Then I tried this for CDN:

<script src="/js/jquery.min.js"></script>
<script src="/js/tether.min.js"></script>
<script src="https://cdnjs.com/libraries/popper.js"></script>
<script src="/js/bootstrap.min.js"></script>

Any ideas what I'm doing wrong?

+17
source share
6 answers

https://cdnjs.com/libraries/popper.js does not look like the correct src for popper, it does not specify a file

bootstrap 4 i use this

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>

and it works fine, try

+5

Bootstrap 4 : jQuery 1.9.1 popper.js 1.12.3. Bootstrap 4, .

  • popper.js: npm install popper.js@^1.12.3 --save
  • jQuery: npm install jquery@1.9.1 --save
  • Bootstrap: npm install bootstrap@4.0.0-beta.2 --save

Bootstrap 4.1

  • npm install popper.js@^1.14.3 --save
  • npm install jquery@3.3.1 --save
  • npm install bootstrap@4.1.1 --save
+33

:

npm install bootstrap jquery popper.js --save

. : -

+12

, popper.js npm.

, , Bower.

bower install popper.js --save
+1

:

  1. js , index.html
  2. popper.min.js js https://github.com/FezVrasta/popper.js#installation

for example: https://unpkg.com/popper.js/dist/umd/popper.min.js

  1. Modify your inclusion script to look like this:

    src = "JS / popper.min.js"

Please note that you have removed Popper from version control npm, so you will have to download updates manually.

+1
source

npm install popper.js --save

Find out more here https://github.com/FezVrasta/popper.js#installation

0
source

Source: https://habr.com/ru/post/1688471/


All Articles