当我执行composer require laravel/passport
时,我得到
将^5.0版用于laravel/passport./composer. json已更新正在加载包含包信息的composer存储库更新依赖项(包括require-dev)无法将您的要求解析为可安装的包集。
问题1 -安装请求laravel/passport ^5.0 -〉satisfiable by laravel/passport[v5.0.0]. -结论:remove laravel/framework v5.5.34 -结论:不要安装laravel/framework v5.5.34 - laravel/passport v5.0.0 requires illuminate/encryption ~5.6 -〉satisfiable by illuminate/encryption[v5.6.0,v5.6.1,v5.6.2,v5.6.3]. -不要安装illuminate/encryption v5.6.0|不要安装laravel/framework v5.5.34 -不要安装illuminate/encryption v5.6.1|不要安装laravel/framework v5.5.34 -不要安装illuminate/encryption v5.6.2|不要安装laravel/framework v5.5.34 -不要安装illuminate/encryption v5.6.3|don't install laravel/framework v5.5.34 - Installation request for laravel/framework(locked at v5.5.34,required as 5.5.*)-〉satisfiable by laravel/framework[v5.5.34].
安装失败,正在将./composer.json还原为其原始内容。
我认为这意味着我的illuminate/encryption
版本与此版本的laravel/passport
不兼容
这是正确的吗?解决这个问题的最佳方法是什么?我甚至不知道如何查看我拥有的illuminate/encryption
的版本。它不会显示在composer show
中。
这里是我的composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"fideloper/proxy": "~3.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"tymon/jwt-auth": "dev-develop"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0",
"symfony/thanks": "^1.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
3条答案
按热度按时间xa9qqrwz1#
Passport 5.0依赖于
Illuminate
包的5.6版本。我可以看到你安装了Laravel 5.5,所以要么升级Laravel到5.6,要么使用Passport的4.0分支。Passport存储库中
composer.json
的"require"
部分指定了所有内容:Illuminate
版本号与框架一致,因此Laravel 5.6将使用Illuminate 5.6,5.5将使用Illuminate 5.5等。参见:Upgrade Guide - Upgrading To 5.6.0 From 5.5。
7lrncoxx2#
我在使用Laravel Framework 5.4时遇到了同样的问题
使用较低版本的passport解决了问题
composer require laravel/passport "4.0.3"
bq9c1y663#
我得到了这个相同的问题我解决了这个使用以下命令
composer require laravel/passport -W
-W(--with-all-dependencies)允许对当前锁定到特定版本的软件包进行升级、降级和删除。