bower install <name> = <package>#<version>正在安装错误的包

时间:2015-09-04 21:25:43

标签: angularjs version bower-install

我正在尝试在项目文件夹中安装angular-route#1.3.18 bower_components/angular-route1.3。但是当我尝试时,它会不断尝试安装angular而不是angular-route

>bower install angular-route1.3=angular-route#1.3.18

bower angular_route1.3#1.3.18   cached git://github.com/angular/bower-angular-route.git#1.3.18
bower angular_route1.3#1.3.18 validate 1.3.18 against git://github.com/angular/bower-angular-route.git#1.3.18
bower angular#1.3.18            cached git://github.com/angular/bower-angular.git#1.3.18
bower angular#1.3.18          validate 1.3.18 against git://github.com/angular/bower-angular.git#1.3.18
bower angular#>=1.3.0           cached git://github.com/angular/bower-angular.git#1.4.5
bower angular#>=1.3.0         validate 1.4.5 against git://github.com/angular/bower-angular.git#>=1.3.0

Unable to find a suitable version for angular, please choose one:
    1) angular#1.3.18 which resolved to 1.3.18 and is required by angular_route1.3#1.3.18
    2) angular#1.4.4 which resolved to 1.4.4 and is required by angular-route#1.4.4
    3) angular#>=1.3.0 which resolved to 1.4.5 and is required by angular-bootstrap#0.13.0

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

我执行以下操作,并找到正确的包和版本:

>bower install angular-route#1.3.18

...但我不希望它安装为bower-components/angular-route,因为我已经在项目中有一个较新版本的angular-route,我需要保留(我们正在转换到1.4应用程序的某些部分仍然需要1.3)。

为什么当我给包裹命名时,bower尝试安装Angular,但是当我不给它时安装angular-route?如何让它做我想做的事?

1 个答案:

答案 0 :(得分:0)

Bower默认情况下&#34;使用平面依赖关系树,每个包只需要一个版本,从而将页面加载降至最低。&#34;

如果您要安装多个版本,可以尝试this answer here