我正在尝试安装一个包,例如bower install restangular --save
然后Bower要求我选择一个Angular版本:
> Unable to find a suitable version for angular, please choose one:
> 1) angular#1.2.6 which resolved to 1.2.6 and has ang-changeorg, angular-cookies#1.2.6, angular-mocks#1.2.6, angular-resource#1.2.6,
> angular-sanitize#1.2.6, angular-scenario#1.2.6 as dependants
> 2) angular#1.2.17-build.226+sha.b6388b3 which resolved to 1.2.17-build.226+sha.b6388b3 and has angular-animate#1.2.17-build.226+sha.b6388b3 as dependants
> 3) angular#* which resolved to 1.2.18 and has restangular#1.4.0 as dependants
> 4) angular#~1.2.0 which resolved to 1.2.19-build.258+sha.ea653e4 and has angularfire#0.7.1 as dependants
> 5) angular#>= 1.0.8 which resolved to 1.3.0-build.2845+sha.e57ad6a and has angular-ui-router#0.2.10 as dependants
>
> Prefix the choice with ! to persist it to bower.json
在这些选项中,
ang-changeorg
是我本地另一个项目,与我当前的工作目录无关。我的当前项目的
bower.json
如下所示:{
"name": "ang-changeorg",
"version": "0.0.0",
"appPath": "public",
"dependencies": {
"angular": "1.2.6",
"json3": "~3.2.6",
"es5-shim": "~2.1.0",
"jquery": "~1.10.2",
"bootstrap": "~3.0.3",
"angular-resource": "1.2.6",
"angular-cookies": "1.2.6",
"angular-sanitize": "1.2.6",
"firebase": "~1.0.11",
"angularfire": "~0.7.1",
"spin.js": "~2.0.0",
"angular-ui-router": "~0.2.10",
"angular-animate": "~1.2.16",
"ng-file-upload": "~1.4.0"
},
"devDependencies": {
"angular-mocks": "1.2.6",
"angular-scenario": "1.2.6"
},
"resolutions": {
"angular": "1.2.6"
}
}
bower cache clean
无法解决此问题。
为什么 bower 列出 ang-changeorg
作为一个依赖项?关于这些 AngularJS 版本依赖项是如何工作的,更清晰的解释将会很棒。