hip
hip

Reputation: 43

Unable to install Bootstrap 5.0.1 package in Laravel 8

Laravel 8 moved to Tailwind instead of Bootstrap. As I need latest Bootstrap (v5.0.1 so far) for my new project I added Bootstrap via npm, but it brings v4.6.0 instead of v5.0.1. I've tried updating the version number in composer.json and composer.lock (to ^5.0.0) before creating a new empty public/css/app.css and running run dev. I get v4.6.0 again!

Googling hasn't been a solution to find a clear explanation as how to update to latest Bootstrap package. I could add it as a custom css but I need it to go through postcss (which by the way has some unsolved issues so far) or similar CSS processor.

Tried clearing cache, just in case with no luck.

Any help appreciated.

Upvotes: 1

Views: 794

Answers (2)

user3187891
user3187891

Reputation:

Just use LATEST instead of NEXT.

npm install bootstrap@latest bootstrap-icons @popperjs/core --save-dev

Upvotes: 1

hip
hip

Reputation: 43

I found a video tutorial solving (almost totally) my question (Spanish): https://www.youtube.com/watch?v=MXLiTcNIK2Q

Basically he installs bootstrap via ui. That installs v4.x.x as described in my question. Then he uses the following line: npm install bootstrap@next, which he gets from official Bootstrap website, despite I can't find it there anymore. The '@next' seems to do the trick but no clue about it, sorry.

That installed in my Laravel project bootstrap 5.0.0-beta3 (instead of latest 5.0.1, no clue either). Updating popper is what finally makes it all work.

In the video you can see how to install bootstrap --auth, too. But that was not part of my original question.

Despite I still don't know how to get to latest Bootstrap 5 version it solved my project so far. Any clues about that and about the '@next' bit are welcome.

Have a nice day!

Upvotes: 0

Related Questions