在Bower中找到冲突包,找到要安装的正确包

时间:2014-11-05 14:36:52

标签: javascript php symfony bower

我正在使用SpBowerBundle来管理我的Symfony2项目上的JS库。它工作到几天前,当我尝试升级包时,我收到此错误:

bower        ECONFLICT Unable to find suitable version for moment

由于我正在使用的软件包版本,我怀疑问题出在我的bower.json文件中。这是上述文件的内容:

{
    "name": "AppBundle",
    "dependencies": {
        "jquery": "latest",
        "jquery-migrate": "latest",
        "bootstrap": "latest",
        "font-awesome": "latest",
        "bootstrapvalidator": "master",
        "pwstrength-bootstrap": "latest",
        "select2": "latest",
        "fuelux": "latest",
        "moment": "master",
        "x-editable": "latest",
        "datatables": "latest",
        "bootbox": "latest",
        "knockout": "latest",
        "jquery-file-upload": "latest"
    }
}

然后,

  • 如何找到冲突包?任何日志?
  • 如何安装每个软件包的最新版本?我的意思是我应该使用哪个字符串?

1 个答案:

答案 0 :(得分:9)

冲突的包是“时刻”,你可以看到错误信息:

bower        ECONFLICT Unable to find suitable version for moment

使用最新版本的凉亭,您可以获得有关冲突的更多信息:

Unable to find a suitable version for moment, please choose one:
    1) moment#master which resolved to d5ff2cfc00 and is required by AppBundle
    2) moment#2.7.0 which resolved to 2.7.0 and is required by fuelux#3.2.1

bower.json中设置的时刻依赖关系与“fuelux”所需的时刻之间存在冲突。
要解决冲突,您可以将以下内容添加到bower.json以强制特定版本的时刻:

"resolutions": {
    "moment": "2.7.0"
  }