我正在尝试在 Laravel 8 中实现自动备份。我决定使用 Laravel-backup 包“spatie/laravel-backup”。
当我尝试使用“composer require spatie/laravel-backup”安装软件包时出现问题。
我遇到这个问题:
问题 1 - spatie/laravel-backup[8.1.0, ..., v8.x-dev] 需要照亮/控制台 ^9.0 -> 发现照亮/控制台[v9.0.0-beta.1, ... , 9.x-dev] 但这些没有加载,可能是因为它与另一个需求冲突。 - 根composer.json需要spatie/laravel-backup ^8.1 ->可由spatie/laravel-backup[8.1.0, 8.1.1, 8.1.2, v8.x-dev]满足。
我尝试从类似的问题运行这些命令,答案没有任何改变:
-composer 需要 spatie/laravel-backup "^8.1" --ignore-platform-reqs
-作曲家需要 spatie/laravel-medialibrary
我还尝试删除供应商和composer.lock,然后运行composer install,问题仍然存在。
我猜我的composer.json 文件有问题:
{ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": { "php": "^7.3|^8.0", "ext-gd": "*", "ext-json": "*", "aws/aws-sdk-php": "~3.0", "darkaonline/l5-swagger": "^8.1", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "laravel/framework": "^8.75", "laravel/sanctum": "^2.11", "laravel/tinker": "^2.5", "league/flysystem-aws-s3-v3": "^1.0", "maatwebsite/excel": "^3.1", "tymon/jwt-auth": "^1.0", "ext-pdo": "*" }, "require-dev": { "facade/ignition": "^2.5", "fakerphp/faker": "^1.9.1", "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^5.10", "phpunit/phpunit": "^9.5.10" }, "autoload": { "psr-4": { "App\": "app/", "Database\Factories\": "database/factories/", "Database\Seeders\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Tests\": "tests/" } }, "scripts": { "post-autoload-dump": [ "Illuminate\Foundation\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ], "post-update-cmd": [ "@php artisan vendor:publish --tag=laravel-assets --ansi --force" ], "post-root-package-install": [ "@php -r "file_exists('.env') || copy('.env.example', '.env');"" ], "post-create-project-cmd": [ "@php artisan key:generate --ansi" ] }, "extra": { "laravel": { "dont-discover": [] } }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true }, "minimum-stability": "dev", "prefer-stable": true }
感谢所有花时间查看我的问题的人。 :))
P粉4733635272023-11-11 00:33:51
我在安装 Spatie 备份时使用 Laravel 9.52 和 php 8.2。遇到同样的错误并通过忽略平台要求解决了它。 Git 错误描述中已建议。
composer require spatie/laravel-backup --ignore-platform-req=ext-zip
P粉9937121592023-11-11 00:31:04
根据评论,安装正确版本的 Laravel Backup。解决了这个问题。
composer require spatie/laravel-backup:7.0