Laravel Composer在安装santum时出错:与合同冲突



在作曲家安装laravel sanctum时出现此错误

您的需求无法解析为一组可安装的软件包。问题1-laravel/santum[v2.9.0,…,2.x-dev]需要照明/合同^6.9|^7.0|^8.0->已找到照明/合同[v6.10.0,…,6.x-dev,v7.0.0,…、7.x-dev、v8.0.0,…和8.x-dev]但这些没有加载,可能是因为它与另一个需求冲突。-根composer.json需要laravel/santum^2.9->可通过laravel/santum[v2.9.0,…,2.x-dev].满足

我试图通过安装laravel合同

composer require illuminate/contracts

但是得到这个错误

您的需求无法解析为一组可安装的软件包。

问题1-根composer.json需要illuminat/compacts^8.36,找到了illuminat/Compacts[v8.36.0,v8.36.1,v8.36.2,8.x-dev],但这些文件没有加载,可能是因为它与另一个要求。

Composer.json

{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"darkaonline/l5-swagger": "5.8.*",
"fideloper/proxy": "^4.0",
"fruitcake/laravel-cors": "^2.0",
"iatstuti/laravel-cascade-soft-deletes": "1.0.*",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.2.0",
"morilog/jalali": "3.*",
"niklasravnsborg/laravel-pdf": "^3.1",
"nwidart/laravel-modules": "^5.1",
"predis/predis": "^1.1",
"shetabit/payment": "^2.1",
"ext-json": "*"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\": "app/",
"Modules\": "Modules/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}

laravel/framework固定到v5.8,而laravel/sanctum与v5.8不兼容。它至少需要Laravel v6

您使用的是不支持laravel/sanctum的laravel版本"laravel/framework": "5.8.*"

尝试按照指南将您的项目升级到至少laravel/framework": "7.0.*,在此处输入链接描述

然后运行$composer update

您需要兼容版本的"照明/合同",显然这个包已经存在于您的项目中。检查"composer.json"文件并修复"照明/合同"是否适合"laravel/santum"和laravel版本。

相关内容

  • 没有找到相关文章

最新更新