简短版
我的项目需要使用angular-leaflet,而angular-leaflet有一个长列表的devDependencies,包括jQuery 2。我不想用jQuery 2,我想用jQuery 1.x。如何让bower忽略angular-leaflet的devDependencies并让我使用jQuery 1呢?
详细版
我正在使用bower 1.2.8。这是一个最小的bower.json文件,可以重现我的问题:
{
"name": "bower-test",
"dependencies": {
"jquery": "1.x",
"angular": "1.2.x",
"angular-leaflet": "0.7.x"
}
}
运行
bower install
会导致以下错误:Unable to find a suitable version for jquery, please choose one:
1) jquery#1.x which resolved to 1.11.0 and has bower-test as dependants
2) jquery#2.1.0 which resolved to 2.1.0 and has angular-leaflet#0.7.5 as dependants
3) jquery#>= 1.9.0 which resolved to 2.1.0 and has bootstrap#3.0.3 as dependants
至少我期望
bower install --production
会忽略angular-leaflet中的devDependencies。但是这是结果(与上述相同):Unable to find a suitable version for jquery, please choose one:
1) jquery#1.x which resolved to 1.11.0 and has bower-test as dependants
2) jquery#2.1.0 which resolved to 2.1.0 and has angular-leaflet#0.7.5 as dependants
3) jquery#>= 1.9.0 which resolved to 2.1.0 and has bootstrap#3.0.3 as dependants
为什么Bower不能忽略angular-leaflet的devDependencies?有没有办法让它这样做?