无法找到合适的角度 - 凉亭安装版本

tom*_*456 48 heroku angularjs bower

我已经设置了我的Angular应用程序,所以当它被推送到Heroku时它会运行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::  
Run Code Online (Sandbox Code Playgroud)

我应该怎么做 - 由于去抖功能,我实际上需要Angular 1.3版本

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"
  }
}
Run Code Online (Sandbox Code Playgroud)

nae*_*th7 74

将当前角度依赖关系更新为1.3.x并为angular添加分辨率以抑制提示:

{
  "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"
  }
}
Run Code Online (Sandbox Code Playgroud)


A.I*_*A.I 19

可以在此处找到对该问题的非常好的解释和解决方案:

亭子的决议

只需复制粘贴一些行以供参考:

当您通过Bower为您的应用程序指定依赖项时,某些程序包可能依赖于同一库的不同版本.您必须解决您的应用实际需要的库版本.换句话说,你打破了平局.但你不想每次都打破它,所以保存你的选择.

运行bower install时,解析过程是交互式的.当bower认识到有两个包依赖于不同版本的包时,它会列出所有这些版本并询问:

在此输入图像描述

提示中的下一行非常方便.它写道:

在此输入图像描述

真棒!所以,如果我输入!2,我的选择保存在bower.json中.具体来说,它会添加一个决议条目:

在此输入图像描述

现在,下次运行bower install时,没有我想要的版本的交互式问题,因为我已经解决了我的应用程序的ember应该是版本1.5.1.


Lui*_*yfe 9

你应该更新凉亭(它适用于我):

bower update
Run Code Online (Sandbox Code Playgroud)


Sud*_*ary 5

删除您的/bower_components目录并bower install再次运行..

一个黑客,但仍然有效......!