2016-09-16 35 views
2

我有一个我通过作曲家安装的软件包,需要guzzlehttp >=6.0。有了这个要求,作曲家选择安装6.2.1。允许Composer降级对require的依赖?

我现在试图要求明确要求6.1.1的依赖项。

我得到以下错误: Problem 1 - Can only install one of: guzzlehttp/guzzle[6.1.1, 6.2.1]. - Can only install one of: guzzlehttp/guzzle[6.2.1, 6.1.1]. - Can only install one of: guzzlehttp/guzzle[6.1.1, 6.2.1]. - chargely/chargify-sdk-php v0.1.1 requires guzzlehttp/guzzle 6.1.1 -> satisfiable by guzzlehttp/guzzle[6.1.1]. - Installation request for chargely/chargify-sdk-php ^0.1.1 -> satisfiable by chargely/chargify-sdk-php[v0.1.1]. - Installation request for guzzlehttp/guzzle (locked at 6.2.1) -> satisfiable by guzzlehttp/guzzle[6.2.1].

此外,composer why证实,仅狂饮的那个版本是存在的,因为我的>=6.0要求。

理论上,使用降级版guzzle时,最初的要求应该是可以的。我如何让作曲家做到这一点?

+0

你的'composer.json'现在看起来像什么? –

回答

2

如果你有2个包与并发要求,你可以绕过别名。

在你composer.json,只需添加:

"require": { 
    "guzzlehttp/guzzle": "6.2 as 6.1" 
} 

然后用composer require ...添加新的包。

去检查more detailed answer了解更多。

+0

我很高兴有办法做到这一点,所以谢谢。但遗憾的是,我必须在我的主要composer.json文件中明确地定义这个,当它真的需要安抚我的两个依赖项时(而不是我的实际项目)。虽然谢谢! – Narcissus