【发布时间】:2021-03-19 07:22:34
【问题描述】:
最近我试图在我通过 Composer 工作的项目上安装一个包。安装后,我收到一条消息,提示 Composer 2.0 已发布,并询问我是否要更新它。通常它看起来像是一个稳定的版本,但在更新时没有安装软件包并且弹出了这个错误。
composer require spatie/laravel-tags
Using version ^3.0 for spatie/laravel-tags
./composer.json has been updated
Running composer update spatie/laravel-tags
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 laravel/framework 8.0, found laravel/framework[v8.0.0] but the package is fixed to v7.30.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Problem 2
- spatie/laravel-tags[3.0.0, ..., 3.0.1] require laravel/framework ^8.0 -> found laravel/framework[v8.0.0, ..., 8.x-dev] but the package is fixed to v7.30.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires spatie/laravel-tags ^3.0 -> satisfiable by spatie/laravel-tags[3.0.0, 3.0.1].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
任何人都遇到过这个问题或有任何指导我该如何解决这个问题?
谢谢
【问题讨论】:
-
请分享更多细节 - 给定的问题在我看来与 Composer v2 无关,但与安装在 v7.30.0 中的
laravel/framework相关(如错误消息告诉您的那样) -
@NicoHaase 是的,我的错......它与作曲家 v2 无关......作曲家依赖项中的版本不匹配。我在下面回答了什么解决了我的问题。
标签: php laravel package composer-php version