为什么bower似乎没有使用`bower install`安装缺少的依赖项?

时间:2015-06-20 06:47:07

标签: bower

我试图在新的ember-cli应用中安装ember-cli-foundation-sass。我收到这个错误:

bower install

我像它推荐的那样运行1.11.1但是当我启动服务器时,我看到了相同的错误消息。

如何安装jQuery /*eslint new-cap: [2, {capIsNewExceptions: ["S"]}]*/ var S = require("string"); var lines = S(text).lines();

3 个答案:

答案 0 :(得分:3)

您可以使用bower来安装JQuery!

bower install jquery

...或者如果您需要安装某个版本,请使用

bower install http://code.jquery.com/jquery-<version>.min.js

答案 1 :(得分:1)

resolutions

中使用bower.json
{
  "name": "refactor",
  "private": true,
  "dependencies": {
    "jquery": "~1.11.1",
    "ember-cli-foundation-sass": "1.0.0",
    "font-awesome": "~4.3.0",
    "foundation": "x"
  },
  "resolutions": {
    "jquery": "~1.11.1"
  }
}

这将迫使bower使用特定版本的jQuery。

答案 2 :(得分:0)

我认为问题是我所拥有的指定jquery版本(^1.11.1)与所有其他库不兼容。当我按@Spetron建议输入bower install jquery时,我看到了:

Unable to find a suitable version for jquery, please choose one:
1) jquery#^1.11.1 which resolved to 1.11.3 and is required by spp-ui
2) jquery#>= 1.7.0 < 2.2.0 which resolved to 2.1.4 and is required by ember#1.12.0
3) jquery#>=1.2 which resolved to 2.1.4 and is required by jquery.cookie#1.4.1
4) jquery#>= 2.1.0 which resolved to 2.1.4 and is required by foundation#5.5.2
5) jquery#>=1.6 which resolved to 2.1.4 and is required by jquery-placeholder#2.0.9
6) jquery#~2.1.4 which resolved to 2.1.4

我认为问题是bower install如果无法找到合适的库版本,则不会发出警告或抛出错误。它只是安静,使它看起来像它安装了它所需要的。