21

我正在尝试更新我的角度版本,我认为鲍尔疯了。

我的部门:

    "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 似乎认为 angular-scenario 1.2.0-rc2 需要 angular 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 作为依赖项...

谢谢

4

3 回答 3

25

尝试将此部分添加到您的 bower.json:

"dependencies": {
  ...
},
"resolutions":{
  "angular": "1.2.0-rc.2"
}

注意:分辨率中的角度版本与依赖项中的版本相同。

于 2014-01-21T06:31:11.227 回答
8

我在最新的凉亭版本中遇到了同样的问题。

您可以按照 bower 输出提示进行操作:Prefix the choice with ! to persist it to bower.json从提供的选项中选择一个。然后您bower.json将使用额外的"resolutions": { ... }块进行更新,然后问题将得到解决。

于 2014-01-21T09:17:38.970 回答
1

代替:

"angular": "~1.2.0-rc.2"

尝试:

"angular": "=1.2.0-rc.2"

然而,可能不是正确的方法,但它解决了我项目中的类似问题。

于 2013-10-02T08:35:06.263 回答