我有一个 Laravel 8.75 项目。它使用 livewire 2.12 和其他一些软件包,包括 rappasoft/laravel-livewire-tables 2.15 和wire-elements/modal 1.0。
我想将此包添加到我的项目中:https://github.com/asantibanez/livewire-charts但它需要 livewire 版本 3.0。
我尝试运行
composer require livewire/livewire "^3.0"
,就像这里解释的那样https://livewire.laravel.com/docs/upgrading
这是我收到的错误:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires livewire/livewire ^3.0, found livewire/livewire[v3.0.0-beta.1, ..., v3.1.0] but these were not loaded, likely because it conflicts with another require.
Problem 2
- rappasoft/laravel-livewire-tables is locked to version v2.15.0 and an update of this package was not requested.
- rappasoft/laravel-livewire-tables v2.15.0 requires livewire/livewire ^2.6 -> found livewire/livewire[v2.6.0, ..., 2.x-dev] but it conflicts with your root composer.json require (^3.0).
Problem 3
- wire-elements/modal is locked to version 1.0.8 and an update of this package was not requested.
- wire-elements/modal 1.0.8 requires livewire/livewire ^2.0 -> found livewire/livewire[v2.0.0, ..., 2.x-dev] but it conflicts with your root composer.json require (^3.0).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
我知道它与 rappasoft/laravel-livewire-tables 和 Wire-elements/modal 包有冲突,需要 livewire 版本 ^2.6 和 ^2.0。
所以我首先尝试更新这些软件包: 我跑
composer require rappasoft/laravel-livewire-tables "^3.0" -W
这就是我收到的错误:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires rappasoft/laravel-livewire-tables ^3.0 -> satisfiable by rappasoft/laravel-livewire-tables[v3.0.0-beta.1, ..., v3.1.2].
- rappasoft/laravel-livewire-tables[v3.0.0-beta.1, ..., v3.1.2] require livewire/livewire ^3.0|dev-main -> found livewire/livewire[dev-main, v3.0.0-beta.1, ..., v3.1.0] but it conflicts with your root composer.json require (^2.10).
我也有同样的错误
composer require wire-elements/modal "^2.0" -W
看来我在兜圈子,因为这些软件包版本,Livewire 无法升级,但因为 Livewire 版本,我无法升级这些软件包...
我该如何解决这个问题?
由于
rappasoft/laravel-livewire-tables
和wire-elements/modal
没有与livewire/livewire
v2 和 v3兼容的版本,您可以尝试同时更新所有三个软件包。通过运行来做到这一点:
composer require "livewire/livewire:^3.0" "rappasoft/laravel-livewire-tables:^3.0" "wire-elements/modal^2.0"