为 Laravel、Voyager 1.4 安装作曲家包的问题

Issue installing composer package for Laravel, Voyager 1.4

我仍然是 Laravel 的新手,我想在现有的 Laravel 应用程序中安装 Voyager 管理面板,该应用程序尚未开发太久。 Voyager 的 GitHub 在这里:

Voyager Laravel Admin

CLI 是:

sscotti@iMac-Catalina PortalRads % composer require tcg/voyager
Using version ^1.4 for tcg/voyager
./composer.json has been updated
Running composer update tcg/voyager
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - tcg/voyager[1.4.x-dev, ..., 1.x-dev] require doctrine/dbal ^2.5 -> found doctrine/dbal[v2.5.0-BETA2, ..., 2.13.x-dev] but the package is fixed to 3.0.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.
    - tcg/voyager[v1.4.0, ..., v1.4.2] require illuminate/support ~6.0|~7.0 -> found illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires tcg/voyager ^1.4 -> satisfiable by tcg/voyager[v1.4.0, ..., 1.x-dev].

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.json有点大,但最重要的部分可能是:

"require": {
    "php": "^7.3|^8.0",
    "aranyasen/hl7": "^2.0",
    "aws/aws-sdk-php": "^3.163",
    "barryvdh/laravel-snappy": "^0.4.8",
    "bower-asset/bootstrap": "~4.5",
    "bower-asset/dropzone": "^5.7",
    "bower-asset/font-awesome": "~5.14",
    "bower-asset/jquery": "^3.5.1",
    "bower-asset/jquery-migrate": "~3.0",
    "bower-asset/jquery-timepicker-jt": "~1.13",
    "bower-asset/jquery-ui": "~1.12",
    "bower-asset/jquery-validation": "~1.19",
    "bower-asset/moment": "^2.29",
    "bower-asset/moment-timezone": "^0.5.31",
    "bower-asset/pdfjs-dist": "~2.6.347",
    "bower-asset/plupload": "~3.1.2",
    "bower-asset/sumoselect": "~3.0",
    "fideloper/proxy": "^4.2",
    "fruitcake/laravel-cors": "^2.0",
    "fzaninotto/faker": "^1.5",
    "google/recaptcha": "^1.2",
    "guzzlehttp/guzzle": "^7.0.1",
    "intervention/image": "^2.5",
    "jenssegers/agent": "^2.6",
    "laracademy/generators": "^3.0",
    "laravel/framework": "^8.0",
    "laravel/jetstream": "^2.2",
    "laravel/sanctum": "^2.6",
    "laravel/tinker": "^2.0",
    "league/oauth2-google": "^3.0",
    "livewire/livewire": "^2.4",
    "nesbot/carbon": "^2.42",
    "oomphinc/composer-installers-extender": "2.0",
    "phpmailer/phpmailer": "^6.1",
    "rbdwllr/reallysimplejwt": "^4.0",
    "spatie/laravel-cookie-consent": "^2.12",
    "spatie/laravel-csp": "^2.6",
    "spatie/laravel-permission": "^4.0",
    "yajra/laravel-datatables-oracle": "^9.15"

我没有尝试 --with-all-dependencies 选项,我不确定作曲家是否有 'dry-run' 选项。

有关于在现有 Laravel 应用程序上安装的特殊说明,但我需要先获取要安装的软件包。参见:Install for Existing App

  Problem 1
    - tcg/voyager[1.4.x-dev, ..., 1.x-dev] require doctrine/dbal ^2.5 -> found doctrine/dbal[v2.5.0-BETA2, ..., 2.13.x-dev] but the package is fixed to 3.0.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.
    - tcg/voyager[v1.4.0, ..., v1.4.2] require illuminate/support ~6.0|~7.0 -> found illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires tcg/voyager ^1.4 -> satisfiable by tcg/voyager[v1.4.0, ..., 1.x-dev].

第 2 行给出了重要部分:您使用的是 Laravel v8,但 tcg/voyager 与其不兼容。他们的存储库中有多个关于此的错误票,但在修复此问题之前,您要么必须降级 Laravel 要么退出使用 Voyager

这件事发生在我身上。 我通过将 doctrine/dbal 降级到 ^2.6 版本来修复它,因为我项目中其他包的 none 需要晚于 2.6

的 DBAL 版本

https://github.com/the-control-group/voyager/issues/5391#issuecomment-873819579