Composer新增插件问题
相信很多phper们在使用composer添加新插件的时候,会碰到这个问题:”明明这次要安装的是一个新插件,结果提示其他插件安装报错“。
类似的报错如:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- phpoffice/phpspreadsheet is locked to version 1.7.0 and an update of this package was not requested.
- phpoffice/phpspreadsheet 1.7.0 requires ext-zip * -> it is missing from your system. Install or enable PHP's zip extension.
Problem 2
- topthink/think-installer v2.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.1.0] but it does not match the constraint.
- topthink/framework v5.1.23 requires topthink/think-installer 2.* -> satisfiable by topthink/think-installer[v2.0.0].
- topthink/framework is locked to version v5.1.23 and an update of this package was not requested.
其实要解决这个问题很简单,只需要执行一下代码:
composer install --ignore-platform-reqs
composer update --ignore-platform-reqs
忽略掉composer的版本匹配,这样就可以继续正常安装新的包了,快去试试吧