为什么我不能安装oauth2客户端?

时间:2017-03-25 13:33:47

标签: laravel oauth-2.0 composer-php client

与作曲家一起出现一些奇怪的错误,有谁知道接下来我能做什么?我正在尝试在Laravel 5.1上安装oauth2客户端,以便我可以使用它连接到联盟网络API。

Using version ~2.2 for league/oauth2-client
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
- Installation request for league/oauth2-client ~2.2 -> satisfiable by league/oauth2-client[2.2.0].
- Conclusion: remove paragonie/random_compat v1.4.2
- league/oauth2-client 2.2.0 requires paragonie/random_compat ^2.0 -> satisfiable by paragonie/random_compat[v2.0.0, v2.0.1, v2.0.10, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9].
- Can only install one of: paragonie/random_compat[v2.0.0, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.1, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.10, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.2, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.3, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.4, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.5, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.6, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.7, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.8, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.9, v1.4.2].
- Installation request for paragonie/random_compat == 1.4.2.0 -> satisfiable by paragonie/random_compat[v1.4.2].


Installation failed, reverting ./composer.json to its original content.

my composer.json:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "bestmomo/scafold": "dev-master",
    "illuminate/html": "5.*",
    "barryvdh/laravel-dompdf": "0.6.*",
    "davejamesmiller/laravel-breadcrumbs": "~3.0"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1"
},
"autoload": {
    "classmap": [
        "database",
        "app/helpers"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "pre-update-cmd": [
        "php artisan clear-compiled"
    ],
    "post-update-cmd": [
        "php artisan optimize"
    ],
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
}
}

1 个答案:

答案 0 :(得分:0)

安装尝试的输出包含所有信息:

目前安装了paragonie / random_compat v1.4.2。您的新软件包需要paragonie / random_compat ^ 2.0 - 这是一个不兼容的更改(只需查看版本号,而不是代码),因此Composer无法简单地安装新版本。

但是,已安装的某些组件需要旧版本。您可以通过运行composer why paragonie/random_compat找出它是哪一个,并且您还可以通过运行composer why-not paragonie/random_compat ^2.0来找出无法安装新版本的原因,这可能会输出相同的信息

总而言之,我认为如何解决这个问题的建议是:升级Laravel。 5.1相当陈旧,它取决于版本~1.4中的paragonie / random_compat。较新版本的Laravel(5.3和5.4)允许~1.4或~2.0,这可以解决您的问题。

但是,我还没有深入研究这个问题。有可能另一个组件也依赖于此库,并且还需要更新。 Laravel是我的第一个猜测。