我收到以下错误:
Message:
Unable to find suitable version for underscore
Details:
code: ECONFLICT
picks: [object Object],[object Object],[object Object]
使用以下bower文件,此错误我以前从未遇到过。我不能使用交互式shell,因为它被部署到持续集成。我们也更喜欢使用Github repo链接(不要问我为什么)而不是凉亭包。
{
"name": "Nightbird",
"version": "0.0.1",
"main": "src/css/style.scss",
"dependencies": {
"backbone": "git@github.com:jashkenas/backbone.git#1.1.2",
"underscore": "git@github.com:jashkenas/underscore.git#1.6.0",
"aisis-bootstrap-theme": "git@github.com:AdamKyle/Aisis-Bootstrap-Theme.git#0.5.0",
"selectize.js": "git@github.com:brianreavis/selectize.js.git#0.8",
"underscore.string": "git@github.com:epeli/underscore.string.git#v2.3.2",
"jquery-bootpag": "git@github.com:botmonster/jquery-bootpag.git#1.0.5",
"underscore.inflection": "git@github.com:jeremyruppel/underscore.inflection.git",
"moment": "git@github.com:moment/moment.git",
"bootstrap-markdown": "git@github.com:toopay/bootstrap-markdown.git#2.5.0",
"markdown-js": "git@github.com:evilstreak/markdown-js.git#v0.5.0",
"to-markdown": "git@github.com:domchristie/to-markdown.git#v0.0.2",
"font-awesome": "git@github.com:FortAwesome/Font-Awesome.git#4.2.0",
"react-bower": "git@github.com:reactjs/react-bower.git#0.11.1",
"showdown": "git@github.com:coreyti/showdown.git#0.3.1",
"pure": "git@github.com:yahoo/pure.git#0.5.0"
}
}
有什么想法吗?这是一个错误吗?或只是开发人员愚蠢?
答案 0 :(得分:4)
3个不同版本的下划线之间存在冲突
这样做的原因是3个依赖项需要下划线:Nightbird,backbone和underscore.inflection。
使用最新版本的Bower,您可以看到以下信息:
Unable to find a suitable version for underscore, please choose one:
1) underscore#1.6.0 which resolved to 1.6.0 and is required by Nightbird
2) underscore#>=1.5.0 which resolved to 1.6.0 and is required by backbone#1.1.2
3) underscore#~1.7.0 which resolved to 1.7.0 and is required by underscore.inflection#1.2.0
您可以通过将以下内容添加到bower.json来强制bower使用特定版本以解决问题。在这个例子中,它将强制使用1.6.0:
"resolutions": {
"underscore": "1.6.0"
}