【发布时间】:2021-10-15 08:15:41
【问题描述】:
我正在尝试为我正在尝试处理的现有 Symfony 项目安装依赖项。我查看了这个https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file,它说我应该运行更新命令:php composer.phar update。我这样做了,但我收到以下错误:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- phpro/grumphp[v0.12.0, ..., v0.12.1] require composer-plugin-api ~1.0 -> found composer-plugin-api[2.1.0] but it does not match the constraint.
- Root composer.json requires phpro/grumphp ^0.12 -> satisfiable by phpro/grumphp[v0.12.0, v0.12.1].
我不明白我应该做什么。请帮忙。谢谢。
如果我的解释不清楚,我也很抱歉,我没有那么多经验。
【问题讨论】:
-
检查你的composer.json,看看你是否有
composer-plugin-api!如果没有,请使用composer require composer-plugin-api安装它,然后使用composer update重试。 -
@DhiaDjobbi 我尝试安装 composer-plugin-api。起初它说 composer.json 已更新,然后它说“正在加载带有包信息的作曲家存储库。更新依赖项(包括 require-dev)”然后它说“安装失败,正在将 ./composer.json 恢复为其原始内容。”
-
@DhiaDjobbi 你不能安装
composer-plugin-api本身,这是由 Composer 提供的
标签: symfony installation dependencies composer-php