Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Bootstrap 4 with bower

Tags:

I have generated a yeoman website and that comes along with bootstrap 3, how can I install bootstrap 4 instead.

The tutorials all say to just run "bower install bootstrap", but that just installs bootstrap 3 again.

like image 438
Henry00 Avatar asked Oct 12 '15 11:10

Henry00


People also ask

What is Bower components in Angularjs?

Bower is a package manager for the web. To install angular, bower install angular. Angular is grabbed from github. We get a bower_components directory with angular inside of it.


2 Answers

First of all remove old bootstrap from your project (remove bower_components/bootstrap/ directory)

Than you have two options:

1. Bower command with particular version:

bower install bootstrap#4.0 

2. Using bower.json file

create file called bower.json in your project root (see example below)

{     "name": "app-name",     "version": "0.0.1",     "dependencies": {         "bootstrap": "4.0"     } } 

then run

bower install 

I'd recommend second option with bower.json file, because this is more flexible solution, you can use boser.json for other packages you need, by simple adding new line.

like image 50
areim Avatar answered Sep 17 '22 07:09

areim


Boostrap v4 is currently in an alpha state. The command bower install bootstrap installs the latest stable release.

To download the alpha version and save this choice run:

bower install bootstrap#4.0 --force-latest --save 
like image 24
Robin Pokorny Avatar answered Sep 17 '22 07:09

Robin Pokorny