我正在尝试使用bower在我的项目中安装angular-filter,但bower install git://github.com/a8m/angular-filter.git
不断将我的角度版本从1.3.15更新为角度1.4。
这是我的bower.json
"name": "eeee",
"version": "0.1.0",
"dependencies": {
"angular": ">=1.3.*",
"json3": "~3.3.1",
"es5-shim": "~3.0.1",
"jquery": "~2.1.4",
"angular-resource": ">=1.3.*",
"angular-cookies": ">=1.3.*",
"angular-sanitize": ">=1.3.*",
"angular-route": ">=1.3.*"
}
如果我跑:
`bower install git://github.com/a8m/angular-filter.git`
结果是:
bower angular-filter#* not-cached git://github.com/a8m/angular-filter.git#*
bower angular-filter#* resolve git://github.com/a8m/angular-filter.git#*
bower angular#>=1.3.* cached git://github.com/angular/bower-angular.git#1.4.0
bower angular#>=1.3.* validate 1.4.0 against git://github.com/angular/bower-angular.git#>=1.3.*
bower angular#1.4.0 cached git://github.com/angular/bower-angular.git#1.4.0
bower angular#1.4.0 validate 1.4.0 against git://github.com/angular/bower-angular.git#1.4.0
bower angular-filter#* download https://github.com/a8m/angular-filter/archive/v0.5.4.tar.gz
bower angular-filter#* extract archive.tar.gz
bower angular-filter#* resolved git://github.com/a8m/angular-filter.git#0.5.4
bower angular#>=1.3.* install angular#1.4.0
bower angular-filter#~0.5.4 install angular-filter#0.5.4
angular#1.4.0 client/bower_components/angular
angular-filter#0.5.4 client/bower_components/angular-filter
└── angular#1.4.0
这意味着当我想要1.3.15时,我的角度更新为1.4。如何在安装角度过滤器时阻止bower自动更新我的角度版本?
答案 0 :(得分:2)
如果您想使用特定版本,则应删除">="
之前的"1.3.*"
。这基本上意味着:“版本1.3.x或更近期的任何内容。”
对于固定版本,只需使用:"angular": "1.3.5",
根据this answer,Bower正在使用Semver语法。因此,您可以在此页面上找到指定版本的其他方法:https://github.com/npm/node-semver