使用Bower安装Bootstrap 4 [英] Installing Bootstrap 4 with bower

查看:105
本文介绍了使用Bower安装Bootstrap 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个yeoman网站,它与bootstrap 3一起提供,我该如何安装bootstrap 4.

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

所有教程都说只运行"bower install bootstrap",但这只是再次安装了bootstrap 3.

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

推荐答案

首先从项目中删除旧的引导程序(删除bower_components/bootstrap/目录)

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

有两种选择:

1.特定版本的Bower命令:

bower install bootstrap#4.0

2.使用bower.json文件

在项目根目录中创建名为bower.json的文件(请参见下面的示例)

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

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

然后运行

bower install

我建议对bower.json文件使用第二个选项,因为这是更灵活的解决方案,您可以通过简单添加新行将boser.json用于所需的其他软件包.

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.

这篇关于使用Bower安装Bootstrap 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆