Composer 安装 fxp/composer-asset-plugin:~1.3.0 报错,似乎与 composer-plugin-api 有冲突?
composer 安装 fxp/composer-asset-plugin:~1.3.0 报错,具体错误内容如下:
yhm-docker@/yhmweb/qifa$composer global require "fxp/composer-asset-plugin:~1.3.0"
Changed current directory to /home/yhm/.config/composer
./composer.json has been created
Running composer update fxp/composer-asset-plugin
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires fxp/composer-asset-plugin ~1.3.0 -> satisfiable by fxp/composer-asset-plugin[v1.3.0, v1.3.1].
- fxp/composer-asset-plugin[v1.3.0, ..., v1.3.1] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
Installation failed, deleting ./composer.json.
百度了各种结果,都不是我这种问题,特请大佬帮忙看看,该如何解决,谢谢。
回复
1个回答
test
2024-06-24
fxp/composer-asset-plugin[v1.3.0, ..., v1.3.1] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
看这个错误是因为 fxp/composer-asset-plugin:~1.3.0
这个包它需要(require composer-plugin-api ^1.0
),但是你现在这里已经找到了 (composer-plugin-api[2.3.0]
) ,所以跟所需的不匹配就导致装个报错了,所以解决这个冲突就好了。
因为 composer-plugin-api
这个是跟 composer 绑定的,算是 composer 的一个 SDK 的东西。你这里已经是 2.3.0
了,降级到 1.x
就可以了。
composer self-update --1
回复
适合作为回答的
- 经过验证的有效解决办法
- 自己的经验指引,对解决问题有帮助
- 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
- 询问内容细节或回复楼层
- 与题目无关的内容
- “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容