我正在使用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"
}
}
然后,
答案 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"
}