【问题标题】:I got unable to choose suitable version when running bower install运行 bower install 时无法选择合适的版本
【发布时间】:2016-04-08 01:42:48
【问题描述】:

当我运行 bower install 时,我得到下面的输出,让我选择 angular 版本之一:

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 文件中,我设置了 angular 的版本,我不知道为什么它会抱怨版本。

"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"

}

【问题讨论】:

标签: angularjs bower


【解决方案1】:

依赖项需要 3 个不同版本的 angular,而 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. angular#>=1.0.8 已解决 到 1.5.3 并且是 ngstorage#0.3.10
  4. 所必需的
  5. 其余的依赖项需要 1.5.3 - 所以它们没有问题

如您所见,前 2 个依赖项需要较早的 Angular 小版本(1.2.91.3.20)。我检查过,您使用的是这两个插件的最新版本。这意味着您有 3 个选项:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-11-12
    • 2016-06-21
    • 2015-03-27
    • 2014-12-14
    • 1970-01-01
    • 1970-01-01
    • 2017-04-22
    • 2016-05-03
    相关资源
    最近更新 更多