允许Composer降级对require的依赖关系?

Nar*_*sus 3 composer-php

我有一个通过composer安装的需要guzzlehttp的软件包>=6.0。根据这一要求,作曲家选择安装6.2.1。

我现在尝试要求明确要求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需求。

从理论上讲,使用枪口的降级版本可以满足最初的要求。如何让作曲家做到这一点?

Tom*_*uba 6

如果您有2个具有并发性要求的软件包,则可以使用别名。

在您的中composer.json,只需添加:

"require": {
    "guzzlehttp/guzzle": "6.2 as 6.1"
}
Run Code Online (Sandbox Code Playgroud)

然后使用添加新软件包composer require ...

请查看更详细的答案以获取更多信息。