无法删除composer root包依赖包

时间:2018-02-06 17:26:32

标签: composer-php

我需要移除包http-interop/http-middleware并将其替换为http-interop/http-server-middleware

我的composer.json中没有定义的包,但我可以看到来自zendframework/zendframework

在任何情况下,当我尝试运行composer remove http-interop/http-middleware时,它都不会删除包。然后,我在尝试运行composer require http-interop/http-server-middleware

时得到此信息
Problem 1
- Conclusion: don't install http-interop/http-server-middleware 1.1.1
- don't install http-interop/http-server-middleware 1.1.0|remove http-interop/http-middleware 0.2.0
- don't install http-interop/http-server-middleware 1.1.0|don't install http-interop/http-middleware 0.2.0
- don't install http-interop/http-server-middleware 1.1.0|don't install http-interop/http-middleware 0.2.0
- Installation request for http-interop/http-server-middleware ^1.1 -> satisfiable by http-interop/http-server-middleware[1.1.0, 1.1.1].
- Installation request for http-interop/http-middleware (locked at 0.2.0) -> satisfiable by http-interop/http-middleware[0.2.0].

我真的不知道该做什么。

1 个答案:

答案 0 :(得分:0)

如果这是另一个包所需的包,则无法在不删除其他包的情况下将其删除。在你的情况下:你必须首先摆脱zendframework/zendframework,但这肯定不是你想要的。

根据https://packagist.org/packages/http-interop/http-middleware/dependents?page=13,依赖性来自zendframework中的多个包。他们直接需要^0.4.1该包,http-interop/http-server-middleware包含替换部分。那么,您可能先通过添加 http-interop/http-server-middleware并在之后删除http-interop/http-middleware来使其工作吗?