3

真诚地,我不知道该回答什么……我是 Ionic + Angular 的新手……我正在尝试安装 Angular Mocks,但它说的是 Angular 版本。

$ sudo bower install angular-mocks --allow-root
bower angular-mocks#*           cached git://github.com/angular/bower-angular-mocks.git#1.4.1
bower angular-mocks#*         validate 1.4.1 against git://github.com/angular/bower-angular-mocks.git#*
bower angular#1.4.1             cached git://github.com/angular/bower-angular.git#1.4.1
bower angular#1.4.1           validate 1.4.1 against git://github.com/angular/bower-angular.git#1.4.1
bower angular#^1                cached git://github.com/angular/bower-angular.git#1.4.1
bower angular#^1              validate 1.4.1 against git://github.com/angular/bower-angular.git#^1
bower angular#>= 1.0.8          cached git://github.com/angular/bower-angular.git#1.4.1
bower angular#>= 1.0.8        validate 1.4.1 against git://github.com/angular/bower-angular.git#>= 1.0.8
bower angular#>= 1.2.23         cached git://github.com/angular/bower-angular.git#1.4.1
bower angular#>= 1.2.23       validate 1.4.1 against git://github.com/angular/bower-angular.git#>= 1.2.23
bower angular#1.3.16            cached git://github.com/angular/bower-angular.git#1.3.16
bower angular#1.3.16          validate 1.3.16 against git://github.com/angular/bower-angular.git#1.3.16
bower angular#1.3.13            cached git://github.com/angular/bower-angular.git#1.3.13
bower angular#1.3.13          validate 1.3.13 against git://github.com/angular/bower-angular.git#1.3.13

Unable to find a suitable version for angular, please choose one:
    1) angular#1.3.13 which resolved to 1.3.13 and is required by ionic#1.0.0
    2) angular#1.3.16 which resolved to 1.3.16 and is required by angular-resource#1.3.16
    3) angular#>=1.0.0 <1.5.0 which resolved to 1.4.0 and is required by angular-moment#0.9.2
    4) angular#1.4.1 which resolved to 1.4.1 and is required by angular-mocks#1.4.1
    5) angular#^1 which resolved to 1.4.1 and is required by angular-slugify#1.2.0
    6) angular#>= 1.0.8 which resolved to 1.4.1 and is required by angular-ui-router#0.2.13
    7) angular#>= 1.2.23 which resolved to 1.4.1 and is required by ngCordova#0.1.17-alpha

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

? Answer: 
4

2 回答 2

3

angular-mock需要angular,但angular不在您的项目中。ionic它与图书馆捆绑在一起。这意味着您需要版本 1.3.13 -> 选择 #1

于 2015-06-19T10:32:08.993 回答
0

请将此代码添加到 bower.json

"resolutions": {
 "angular": "1.2.0-rc.2"
 }
于 2015-06-19T10:48:10.890 回答