angularjs - ECOFLICT 无法找到适合 Angular 的版本

标签 angularjs bower

这些是我在文件 bower.json 中的依赖项。其中大部分与 AngularJS 有关。

"dependencies": {
  "angular": "~1.3.0",
  "jquery": "~2.1.1",
  "requirejs": "~2.1.15",
  "angular-resource": "~1.3.0",
  "requirejs-domready": "~2.0.1",
  "requirejs-plugins": "~1.0.3",
  "bootstrap-sass-official": "~3.3.0",
  "requirejs-text": "~2.0.12",
  "bourbon": "~4.0.2",
  "jQuery-Tag-This": "~1.1.0",
  "angular-masonry": "~0.9.1",
  "intl-tel-input": "~3.7.1",
  "ngInfiniteScroll": "~1.2.0",
  "moment-jalaali": "~0.3.3",
  "owl.carousel": "*",
  "persian-datepicker": "~0.3.6",
  "persian-date": "~0.1.8",
  "angular-ui-router": "~0.2.14",
  "angular-cookies": "~1.3.15"
}

当我运行bower install时,它会给出以下输出,并显示错误ECONFLICT无法找到适合 Angular 的版本:

bower doc-ready#1.0.x                   validate 1.0.4 against git://github.com/desandro/doc-ready.git#1.0.x
bower get-style-property#~1.0.4           cached git://github.com/desandro/get-style-property.git#1.0.4
bower get-style-property#~1.0.4         validate 1.0.4 against git://github.com/desandro/get-style-property.git#~1.0.4
bower matches-selector#~1.0.2             cached git://github.com/desandro/matches-selector.git#1.0.3
bower matches-selector#~1.0.2           validate 1.0.3 against git://github.com/desandro/matches-selector.git#~1.0.2
bower fizzy-ui-utils#~1.0.1               cached git://github.com/metafizzy/fizzy-ui-utils.git#1.0.1
bower fizzy-ui-utils#~1.0.1             validate 1.0.1 against git://github.com/metafizzy/fizzy-ui-utils.git#~1.0.1
bower get-style-property#1.x              cached git://github.com/desandro/get-style-property.git#1.0.4
bower get-style-property#1.x            validate 1.0.4 against git://github.com/desandro/get-style-property.git#1.x
bower angular#~1.3.0                      cached git://github.com/angular/bower-angular.git#1.3.20
bower angular#~1.3.0                    validate 1.3.20 against git://github.com/angular/bower-angular.git#~1.3.0
bower angular#^1.3.0                      cached git://github.com/angular/bower-angular.git#1.5.0
bower angular#^1.3.0                    validate 1.5.0 against git://github.com/angular/bower-angular.git#^1.3.0
bower angular#>= 1.0.8                    cached git://github.com/angular/bower-angular.git#1.5.0
bower angular#>= 1.0.8                  validate 1.5.0 against git://github.com/angular/bower-angular.git#>= 1.0.8
bower angular#>=1.2.0                     cached git://github.com/angular/bower-angular.git#1.5.0
bower angular#>=1.2.0                   validate 1.5.0 against git://github.com/angular/bower-angular.git#>=1.2.0
bower                                  ECONFLICT Unable to find suitable version for angular

你能告诉我为什么它会给我这个 ECONFLICT 错误吗?

最佳答案

您的 AngularJS 版本存在冲突。您的许多依赖项都依赖于 AngularJS,并且它们无法使用相同的 AngularJS 版本来解决。

您应该尝试将其添加到您的文件 bower.json 中:

"resolutions": {
  "angular": "1.3.0"
}

1.3.0 替换为您实际想要在项目中使用的 AngularJS 版本。

更多信息可以在bower.json specification上找到.

关于angularjs - ECOFLICT 无法找到适合 Angular 的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35239888/

相关文章:

javascript - 如何使用 AngularJS 的 $filter 按年和月对数据进行分组

javascript - 合并多个 Angular scope watch 语句

html - 对自定义属性使用 data- 而不是 x- 前缀有什么好处?

arrays - AngularJS 删除空值

node.js - 每当安装任何软件包时,npm 错误代码 eisdir errno -4068

javascript - 如何从 JSON 数据制作 FlightPlanCoords?

node.js - StriderCD 全局安装后在 bower 访问 $HOME/.config $HOME/.cache 时失败

javascript - Bower 镜像仓库

Bower 安装未能找到令人满意的版本,尽管 GitHub 上有匹配的标签

javascript - jquery的bower.json文件如何指向git中未包含的文件夹?