为什么我不能从角度1.2.23升级到1.3.2
C:\ MyTestProject> bower update angular --save --latest
在我的终端?
然后我将此作为消息:
bower angular#>= 1.0.8 cached git://github.com/angular/bower-angular.git#1.3.2
bower angular#>= 1.0.8 validate 1.3.2 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.2.23
bower angular#1.2.23 validate 1.2.23 against git://github.com/angular/bower-angular.git#1.2.23
bower angular#>=1 cached git://github.com/angular/bower-angular.git#1.3.2
bower angular#>=1 validate 1.3.2 against git://github.com/angular/bower-angular.git#>=1
bower angular#1.2.26 cached git://github.com/angular/bower-angular.git#1.2.26
bower angular#1.2.26 validate 1.2.26 against git://github.com/angular/bower-angular.git#1.2.26
bower angular#>=1.0.0 <1.4.0 cached git://github.com/angular/bower-angular.git#1.3.2
bower angular#>=1.0.0 <1.4.0 validate 1.3.2 against git://github.com/angular/bower-angular.git#>=1.0.0 <1.4.0
Please note that,
MyTestProject depends on angular#1.2.23 which resolved to angular#1.2.23
angular-mocks#1.2.26 depends on angular#1.2.26 which resolved to angular#1.2.26
angular-ui-router#0.2.12 depends on angular#>= 1.0.8 which resolved to angular#1.3.2
angular-bootstrap#0.11.2 depends on angular#>=1 which resolved to angular#1.3.2
angular-moment#0.8.2 depends on angular#>=1.0.0 <1.4.0 which resolved to angular#1.3.2
Resort to using angular#1.2.23 which resolved to angular#1.2.23
Code incompatibilities may occur.
问题是角度模拟吗?
更新
{
"name": "angular-mocks",
"version": "",
"description": "AngularJS mocks for testing",
"main": "angular-mocks.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular.js.git"
},
"keywords": [
"angular",
"framework",
"browser",
"mocks",
"testing",
"client-side"
],
"author": "Angular Core Team <angular-core+npm@google.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular.js/issues"
},
"homepage": "http://angularjs.org"
}
.bower.json
{
"name": "angular-mocks",
"version": "1.2.26",
"main": "./angular-mocks.js",
"dependencies": {
"angular": "1.2.26"
},
"homepage": "https://github.com/angular/bower-angular-mocks",
"_release": "1.2.26",
"_resolution": {
"type": "version",
"tag": "v1.2.26",
"commit": "0eda339dd42aba2628586f39d4806bcfb57fd6f4"
},
"_source": "git://github.com/angular/bower-angular-mocks.git",
"_target": "~1.2.23",
"_originalSource": "angular-mocks"
}
答案 0 :(得分:6)
您可能已将angular-mocks
锁定到特定版本范围,该范围不允许bower将其升级到1.3.2(需要查看您的bower.json
以确定)。当您将核心角度升级到新版本时,请确保您还匹配依赖于主angular
包的所有其他角度核心包的版本规则,即它们需要同步:
# in bower.json
"devependencies": {
angular: ^1.3.2
... ... ...
},
"devDependencies": {
angular-mocks: ^1.3.2
... ... ...
}
更新package.json
后,请运行bower update
更新您的本地软件包。
Angular 1.3核心软件包的示例如下: