23

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.

Martin Lindgren
  • 374
  • 2
  • 14
Henry00
  • 421
  • 1
  • 3
  • 9
  • Try https://github.com/bassjobsen/generator-bootstrap4; Yeoman generator to scaffold out a front-end Bootstrap 4 Web app – Bass Jobsen Nov 24 '15 at 00:30
  • Possible duplicate of [How to install Bootstrap v4 alpha using bower?](http://stackoverflow.com/questions/33156310/how-to-install-bootstrap-v4-alpha-using-bower) – cvrebert Dec 12 '15 at 07:45
  • other way around. this was posted before that one – Henry00 Dec 14 '15 at 09:10

4 Answers4

44

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.

areim
  • 3,371
  • 2
  • 23
  • 29
7

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
Robin Pokorny
  • 10,657
  • 1
  • 24
  • 32
2

this is a right command line

$ bower install bootstrap#v4.0.0-alpha.3

there is official link how to manage bootstrap with other Package managers getbootstrap 4

0

This also works for people using CodeKit (seems like you can't use bower commands in CodeKit)!

1) Delete the old bower_components/bootstrap folder.

2) Create a bower.json file in your root with this content:

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

3. Instrall regular bootstrap version via codekit. --> Version 4.0-alpha will be installed automatically instead of the 3.x stable release.

Tim
  • 139
  • 1
  • 6