无法find合适的angular度 – 凉亭安装版本

我已经build立了我的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:: 

我应该怎么做 – 我实际上需要版本1.3的Angular,因为反弹function

我的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" } } 

将当前的angular度依赖关系更新到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" } } 

这个问题的一个很好的解释和解决可以在这里find:

亭子的决议

只需复制粘贴这里的一些行参考:

当您通过Bower为应用程序指定依赖项时,某些程序包可能依赖于同一个库的不同版本。 你将不得不解决你的应用程序实际需要什么版本的库。 换句话说,你打破了领带。 但是你不想每次都打破它,所以保存你的select。

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

在这里输入图像说明

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

在这里输入图像说明

真棒! 所以,如果我input!2,我的select保存在bower.json中。 具体来说,它会添加一个分辨率条目:

在这里输入图像说明

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

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

 bower update 

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

黑客,但仍然工作..!

您可以运行安装命令,并在提示select版本时,使用(!)感叹号作为前缀选项。 例如!3的第三个选项。 这会被添加到应用程序的bower.json文件中,并解决冲突。

希望这可以帮助。

Interesting Posts