当我composer require laravel/passport
时,我得到了
使用版本^ 5.0作为laravel / passport ./composer.json updated使用包信息加载composer存储库 更新依赖项(包括require-dev)您的需求可以 不能解析为可安装的软件包。
问题1 - laravel / passport ^ 5.0的安装要求 - > laravel / passport [v5.0.0]可以满足。 - 结论:删除laravel / framework v5.5.34 - 结论:不要安装laravel / framework v5.5.34 - laravel / passport v5.0.0需要照明/加密~5.6 - >可以通过illuminate / encryption [v5.6.0,v5.6.1,v5.6.2,v5.6.3]来满足。 - 不要安装illuminate / encryption v5.6.0 |不要安装laravel / framework v5.5.34 - 不要安装照亮/加密v5.6.1 |不要安装laravel / framework v5.5.34 - 不要安装照亮/加密v5.6.2 |不要安装laravel / framework v5.5.34 - 不要安装照明/加密v5.6.3 |不要安装laravel / framework v5.5.34 - laravel / framework的安装请求(锁定在v5.5.34,要求为5.5。*) - > 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
}
}
答案 0 :(得分:8)
Passport 5.0取决于Illuminate
软件包的5.6版。我可以看到你安装了Laravel 5.5,所以要么将Laravel升级到5.6,要么使用Passport的4.0分支。
Passport存储库中"require"
的{{1}}部分已全部指定:
composer.json
"require": {
"php": ">=7.0",
"firebase/php-jwt": "~3.0|~4.0|~5.0",
"guzzlehttp/guzzle": "~6.0",
"illuminate/auth": "~5.6",
"illuminate/console": "~5.6",
"illuminate/container": "~5.6",
"illuminate/contracts": "~5.6",
"illuminate/database": "~5.6",
"illuminate/encryption": "~5.6",
"illuminate/http": "~5.6",
"illuminate/support": "~5.6",
"league/oauth2-server": "^6.0",
"phpseclib/phpseclib": "^2.0",
"symfony/psr-http-message-bridge": "~1.0",
"zendframework/zend-diactoros": "~1.0"
},
版本号与框架对齐,因此Laravel 5.6将使用Illuminate 5.6,5.5将使用Illuminate 5.5等。
答案 1 :(得分:0)
我在使用Laravel Framework 5.4时遇到了同样的问题
使用较低版本的护照解决了
composer require laravel/passport "4.0.3"