在运行bower安装时我无法选择合适的版本

时间:2016-04-08 01:42:49

标签: angularjs bower

当我运行bower install时,我得到了以下输出,让我选择其中一个版本的角度:

Unable to find a suitable version for angular, please choose one:
1) angular#~1.2.9 which resolved to 1.2.29 and is required by at-table#1.0.7
2) angular#~1.3 which resolved to 1.3.20 and is required by angular-notify#2.5.0
3) angular#>=1.0.8 which resolved to 1.5.3 and is required by ngstorage#0.3.10
4) angular#^1.5.0 which resolved to 1.5.3 and is required by cooltoo
5) angular#^1.0.8 which resolved to 1.5.3 and is required by angular-ui-router#0.2.18
6) angular#1.5.3 which resolved to 1.5.3 and is required by angular-cookies#1.5.3
7) angular#^1.1.5 which resolved to 1.5.3 and is required by angular-file-upload#2.2.0
8) angular#^1.2 which resolved to 1.5.3 and is required by ng-table#0.8.3

但是在我的bower.json文件中,我设置了角度的版本,我不知道它为什么抱怨该版本。

"dependencies": {
"requirejs": "~2.1.20",
"angular": "^1.5.0",
"angular-ui-router": "^0.2.18",
"bootstrap": "^3.3.6",
"jquery": "^2.2.1",
"angular-cookies": "^1.5.2",
"ngstorage": "^0.3.10",
"at-table": "^1.0.7",
"angular-file-upload": "^2.2.0",
"angular-notify": "^2.5.0"

}

1 个答案:

答案 0 :(得分:1)

依赖关系需要3个不同版本的角度,而Bower不知道使用哪个版本,所有三个需要三个不同的次要版本:

  1. angular#~1.2.9解析为 1.2.29 并且是必需的 at-table#1.0.7 2)
  2. angular#~1.3分辨为 1.3.20 并且是 angular-notify#2.5.0 3)
  3. 要求
  4. angular#> = 1.0.8已解决 1.5.3 ,并且是ngstorage#0.3.10
  5. 所必需的
  6. 其余的依赖项需要1.5.3 - 所以它们没有问题
  7. 正如您所看到的,前2个依赖项需要早期的角度小版本(1.2.91.3.20)。我查了一下,你正在使用这两个插件的最新版本。这意味着您有3个选项:

    1. 您可以删除at-tableangular-notify并找到替代方案。
    2. 要求作者更新他们的依赖关系。
    3. 在GitHub上克隆回购并自行更改依赖项(herehere)。