我正在尝试更新我的角度版本,我认为凉亭只是疯了。
我的代表:
"dependencies": {
"underscore":"*",
"momentjs":"~2.2.1",
"bootstrap": "~3.0.0",
"jquery": "~1.9.1",
"jquery.cookie": "*",
"jquery-ui": "~1.10.3",
"jquery-file-upload": "*",
"angular": "~1.2.0-rc.2",
"angular-route": "~1.2.0-rc.2",
"angular-resource": "~1.2.0-rc.2",
"angular-animate": "~1.2.0-rc.2",
"angular-cookies": "~1.2.0-rc.2",
"angular-i18n": "~1.2.0-rc.2",
"angular-bootstrap" : "*",
"ng-grid": "*",
"highcharts": "*",
"highcharts-ng": "*"
},
"devDependencies": {
"angular-mocks": "~1.2.0-rc.2",
"angular-scenario": "~1.2.0-rc.2"
}
重要的是:所有角度模块都是版本1.2.0-rc.2
但是在做的时候
bower install
结果如下:
Unable to find a suitable version for angular, please choose one:
1) angular#1.0.8 which resolved to 1.0.8 and has angular-scenario#1.2.0-rc.2 as dependants
2) angular#1.2.0-rc.2 which resolved to 1.2.0-rc.2 and has angular-animate#1.2.0-rc.2, angular-cookies#1.2.0-rc.2, angular-mocks#1.2.0-rc.2, angular-resource#1.2.0-rc.2, angular-route#1.2.0-rc.2, angular-scenario#1.2.0-rc.2 as dependants
3) angular#~1.2.0-rc.2 which resolved to 1.2.0-rc.2 and has tael-web as dependants
4) angular#>=1 which resolved to 1.2.0-rc.2 and has angular-bootstrap#0.6.0 as dependants
5) angular#>=1.0.4 which resolved to 1.2.0-rc.2 and has highcharts-ng#0.0.2 as dependants
bower似乎认为角度情景1.2.0-rc2需要角度1.0.8 ...... ???
实际上只是假:https://github.com/angular/bower-angular-scenario/tree/v1.2.0-rc.2
bower.json:
{
"name": "angular-scenario",
"version": "1.2.0-rc.2",
"main": "./angular-scenario.js",
"dependencies": {
"angular": "1.2.0-rc.2"
}
}
我在这里缺少什么?我该怎么做才能解决这个问题?要明确:我不想使用交互式冲突解决方法,因为这是在远程CI上出现的。我只想强调 * 如何将角度场景1.2.0-rc2视为角度1.0.8作为依赖...
谢谢
答案 0 :(得分:25)
尝试将此部分添加到您的bower.json:
"dependencies": {
...
},
"resolutions":{
"angular": "1.2.0-rc.2"
}
注意:分辨率中的角度版本与依赖项中的版本相同。
答案 1 :(得分:8)
最新的凉亭版本遇到了同样的问题。
您可以按照bower输出提示: Prefix the choice with ! to persist it to bower.json
从提供的选项中选择一个。然后,我们会使用其他 bower.json
块更新您的"resolutions": { ... }
,然后问题就会得到解决。
答案 2 :(得分:1)
而不是:
"angular": "~1.2.0-rc.2"
尝试:
"angular": "=1.2.0-rc.2"
可能不是正确的方法,但它在我的项目中解决了类似的问题。