Bootstrap 4 Installation With Laravel 5.7

Pablo Curumaco picture Pablo Curumaco · Dec 12, 2018 · Viewed 26.2k times · Source

I am trying to compile my app.scss file that comes with my new project from Laravel, but I want to install Bootstrap 4. At the time of doing my npm run dev does not install Bootstrap 4, but it still has the Bootstrap that Laravel brings by default.

Any recommendations or documentation for this?

enter image description here

Answer

Marcin Nabiałek picture Marcin Nabiałek · Dec 12, 2018

In fact Laravel comes with Bootstrap 4 by default. If you take a look at https://github.com/laravel/laravel/blob/master/package.json file (you should have package.json in your project too) you will see line:

"bootstrap": "^4.0.0"

what means Bootstrap 4 will be installed.

You should run

npm install

to install all packages and by default it will install Bootstrap 4.

This ~ sign mean here node_modules directory so in fact line

@import "~bootstrap/scss/bootstrap"

means

@import "node_modules/bootstrap/scss/bootstrap"