【问题标题】:Composer 2.0 ProblemsComposer 2.0 问题
【发布时间】: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


【解决方案1】:

我通过先运行 composer outdated -D 并手动更新 composer.json 中 laravel/framework 的版本然后运行 ​​composer update 解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-14
    • 2017-05-27
    • 2014-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-26
    相关资源
    最近更新 更多