提问人:Petitemo 提问时间:11/10/2023 最后编辑:Petitemo 更新时间:11/10/2023 访问量:44
在将 livewire 版本从 2.0 更新到 3.0 时,如何解决与软件包的冲突?
How can I resolve conflicts with packages while updating livewire version from 2.0 to 3.0?
问:
我有一个 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 版。
我试着像这里解释的那样运行 https://livewire.laravel.com/docs/upgradingcomposer require livewire/livewire "^3.0"
这是我收到的错误:
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版本,我无法升级这些包......
我怎样才能解决这个问题?
编辑:
根据 Haase @Nico评论,我尝试运行:composer require wire-elements/modal:^2.0 rappasoft/laravel-livewire-tables:^3.0 livewire/livewire:^3.0 -W
我收到另一个错误:
Problem 1
- blade-ui-kit/blade-heroicons 2.1.0 requires illuminate/support ^9.0|^10.0 -> found illuminate/support[v9.0.0-beta.1, ..., 9.x-dev, v10.0.0, ..., 10.x-dev] but these were not loaded, likely because it conflicts with another require.
- rappasoft/laravel-livewire-tables[v3.0.0-beta.1, ..., v3.1.2] require blade-ui-kit/blade-heroicons ^2.1 -> satisfiable by blade-ui-kit/blade-heroicons[2.1.0].
- Root composer.json requires rappasoft/laravel-livewire-tables ^3.0 -> satisfiable by rappasoft/laravel-livewire-tables[v3.0.0-beta.1, ..., v3.1.2].
答:
由于没有与 v2 和 v3 兼容的版本,您可以尝试同时更新所有三个软件包。为此,请运行:rappasoft/laravel-livewire-tables
wire-elements/modal
livewire/livewire
composer require "livewire/livewire:^3.0" "rappasoft/laravel-livewire-tables:^3.0" "wire-elements/modal^2.0"
但也要记住,目前没有 Laravel 的 8.75 版本。 在 v3 中需要 Laravel 10livewire/livewire
评论