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.

百度了各种结果,都不是我这种问题,特请大佬帮忙看看,该如何解决,谢谢。

阅读 1k
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.

看这个错误是因为 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
推荐问题
宣传栏