我已经设置了Angular应用程序,因此将其推送到Heroku时即可运行bower install。但是由于版本问题,我遇到了错误。
bower install
在bower install本地运行时,我会看到以下提示:
Unable to find a suitable version for angular, please choose one: 1) angular#1.2.16 which resolved to 1.2.16 and is required by angular-resource#1.2.16 2) angular#1.2.23 which resolved to 1.2.23 and is required by angular-cookies#1.2.23 3) angular#>= 1.0.8 which resolved to 1.2.25 and is required by angular-ui-router#0.2.10 4) angular#^1 which resolved to 1.2.25 and is required by angular-ui-codemirror#0.1.6 5) angular#~1.2.2 which resolved to 1.2.25 and is required by splitter#f5c2195050 6) angular#>=1.0.6 which resolved to 1.2.25 and is required by angular-elastic#2.4.0 7) angular#~1.2 which resolved to 1.2.25 and is required by angular-nanoscroller#0.2.1 8) angular#~1.2.9 which resolved to 1.2.25 and is required by angular-sockjs#0.0.1Prefix the choice with ! to persist it to bower.json ? Answer::
我该怎么办-由于具有反跳功能,实际上我需要Angular 1.3版
我的bower.json样子是这样的:
bower.json
{ "name": "myapp", "version": "0.0.1", "dependencies": { "json3": "~3.3.1", "es5-shim": "~3.1.0", "angular-resource": "1.2.16", "angular-sanitize": "1.2.16", "angular-animate": "1.2.16", "angular-ui-router": "~0.2.10", "jquery": "~2.1.1", "angular-ui-codemirror": "~0.1.6", "splitter": "*", "angular-cookies": "~1.2.23", "angular-elastic": "~2.4.0", "angular-local-storage": "~0.0.7", "chance": "~0.5.6", "nanoscroller": "~0.8.4", "angular-nanoscroller": "~0.2.1", "angular-sockjs": "~0.0.1" } }
将当前的角度依赖关系更新为1.3.x,并为角度添加分辨率以消除提示:
{ "name": "myapp", "version": "0.0.1", "dependencies": { "angular": "~1.3.x", "angular-animate": "~1.3.x", "angular-cookies": "~1.3.x", "angular-resource": "~1.3.x", "angular-sanitize": "~1.3.x", "angular-ui-router": "~0.2.10", "angular-ui-codemirror": "~0.1.6", "angular-elastic": "~2.4.0", "angular-local-storage": "~0.0.7", "angular-nanoscroller": "~0.2.1", "angular-sockjs": ">=0.0.1", "json3": "~3.3.1", "es5-shim": "~3.1.0", "jquery": "~2.1.1", "splitter": "*", "chance": "~0.5.6", "nanoscroller": "~0.8.4" }, "resolutions": { "angular": "~1.3.x" } }