无法找到合适的角度版本

时间:2015-05-19 13:22:51

标签: angularjs bower

我继续收到此错误。有什么想法吗?

$ bower install ng-roundabout --save
bower cached        git://github.com/angular/bower-angular-mocks.git#1.3.15
bower validate      1.3.15 against git://github.com/angular/bower-angular-mocks.
git#>=1.2.*
bower cached        git://github.com/Wildhoney/ngRoundabout.git#0.2.5
bower validate      0.2.5 against git://github.com/Wildhoney/ngRoundabout.git#*
bower cached        git://github.com/angular/bower-angular-mocks.git#1.2.28
bower validate      1.2.28 against git://github.com/angular/bower-angular-mocks.
git#~1.2.24
bower cached        git://github.com/angular/bower-angular.git#1.2.28
bower validate      1.2.28 against git://github.com/angular/bower-angular.git#~1
.2.24
bower cached        git://github.com/angular/bower-angular.git#1.3.15
bower validate      1.3.15 against git://github.com/angular/bower-angular.git#>=
1.2.0
bower cached        git://github.com/angular/bower-angular.git#1.3.15
bower validate      1.3.15 against git://github.com/angular/bower-angular.git#>=
1.2.*
bower cached        git://github.com/angular/bower-angular.git#1.3.15
bower validate      1.3.15 against git://github.com/angular/bower-angular.git#>=
1
bower cached        git://github.com/angular/bower-angular.git#1.2.28
bower validate      1.2.28 against git://github.com/angular/bower-angular.git#1.
2.28
bower cached        git://github.com/angular/bower-angular.git#1.3.15
bower validate      1.3.15 against git://github.com/angular/bower-angular.git#>=
 1.0.8
bower cached        git://github.com/angular/bower-angular.git#1.3.15
bower validate      1.3.15 against git://github.com/angular/bower-angular.git#~1


Unable to find a suitable version for angular, please choose one:
    1) angular#~1.2.24 which resolved to 1.2.28 and is required by ng-roundabout
#0.2.5
    2) angular#1.2.28 which resolved to 1.2.28 and is required by angular-mocks#
1.2.28
    3) angular#1.3.15 which resolved to 1.3.15 and is required by angular-animat
e#1.3.15, angular-cookies#1.3.15, angular-mocks#1.3.15, angular-resource#1.3.15,
 angular-sanitize#1.3.15, angular-scenario#1.3.15, angular-touch#1.3.15
    4) angular#>=1.2.0 which resolved to 1.3.15 and is required by angular-googl
e-maps#2.1.0
    5) angular#>=1.2.* which resolved to 1.3.15 and is required by AutoPrivilege

    6) angular#>=1 which resolved to 1.3.15 and is required by angular-bootstrap
#0.11.2
    7) angular#>= 1.0.8 which resolved to 1.3.15 and is required by angular-ui-r
outer#0.2.14
    8) angular#~1 which resolved to 1.3.15 and is required by ng-table#0.5.4

Prefix the choice with ! to persist it to bower.json

? Answer:

bower.json:

{
  "name": "xxxxxxx",
  "version": "1.0.0",
  "dependencies": {
    "angular": ">=1.2.*",
    "json3": "~3.3.1",
    "es5-shim": "~3.0.1",
    "jquery": "~1.11.0",
    "bootstrap": "~3.1.1",
    "angular-resource": ">=1.2.*",
    "angular-cookies": ">=1.2.*",
    "angular-sanitize": ">=1.2.*",
    "angular-bootstrap": "~0.11.0",
    "font-awesome": ">=4.1.0",
    "lodash": "~2.4.1",
    "angular-ui-router": "~0.2.10",
    "angular-google-maps": "~2.1.0",
    "angular-animate": "~1.3.15",
    "ng-table": "~0.5.4",
    "angular-touch": "~1.3.15"
  },
  "devDependencies": {
    "angular-mocks": ">=1.2.*",
    "angular-scenario": ">=1.2.*"
  }
}

1 个答案:

答案 0 :(得分:15)

您的某些依赖项详细声明了对特定版本的angular的依赖性。大多数情况下,您可以使用没有影响的上层版本。

添加

"resolutions"    : {
    "angular"  : "1.3.15",
  }

到您的凉亭文件以强制使用角度版本

此外,您应该清理您的凉亭文件的角度版本。你要求ng-animate 1.3.15+和angular 1.2+。出于理智的考虑,所有角度模块版本都应该相同。