我正在尝试安装一个软件包 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
没解决这个问题.
为什么凉亭ang-changeorg
列为依赖?关于这些angularjs版本依赖如何工作的清晰度将是非常棒的.
这是因为在你的bower.json中,你的项目名称是ang-changeorg
{
"name": "ang-changeorg",
"version":
以及该文件中的所有依赖项
"dependencies": {
"angular": "1.2.6",
"json3": "~3.2.6",
"es5-shim": "~2.1.0",
"jquery": "~1.10.2",
...
是"名称":"ang-changeorg"依赖于.因此,ang-changeorg依赖于角度#1.2.6,因为角度的1.2.6版本在您的凉亭文件中指定:
"dependencies": {
"angular": "1.2.6",