bower 可以同时安装两个版本的 bootstrap 么?

2015-04-27 16:33:04 +08:00
 eeeeeeve
试了下,好像不行啊:(

如何配置才能同时安装两个版本的bootstrap呢?

{
"name": "import_react",
"version": "0.1",
"authors": [
"forest <forest@tom.com>"
],
"moduleType": [
"amd"
],
"dependencies": {
"bootstrap": "3.0.3",
"bootstrap": "2.0.2"
},
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
3052 次点击
所在节点    Node.js
3 条回复
Niphor
2015-04-27 17:08:06 +08:00
```
bower install <name>=<package>#<version>
```
这样试试?
eeeeeeve
2015-04-27 17:14:00 +08:00
@Niphor 不行,也只能安装一个版本
Niphor
2015-04-27 21:05:47 +08:00
@eeeeeeve 可以啊

```
bower install bootstrap --save
bower install bootstrap-v2=bootstrap#2.3.2 --save
bower list
bower check-new Checking for new versions of the project dependencies..
demo#0.0.0 D:\demo
├─┬ bootstrap#3.3.4
│ └── jquery#2.0.3 (2.1.3 available)
└─┬ bootstrap-v2#2.3.2 (latest is 3.3.4)
└── jquery#2.0.3 (latest is 2.1.3)

```

bower.json
```
"dependencies": {
"bootstrap": "~3.3.4",
"bootstrap-v2": "bootstrap#2.3.2"
}
```

不过3.3.4可以用2.1.3的jquery,你也可以再取个名字把jquery也放2个...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/186723

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX