当前位置:  开发笔记 > 编程语言 > 正文

Composer - illuminate/redis安装失败,因为不同版本的照明/支持

如何解决《Composer-illuminate/redis安装失败,因为不同版本的照明/支持》经验,为你挑选了1个好方法。

我为一个新项目创建了一个全新的Lumen安装,我正在尝试将Redis设置为Cache/Session驱动程序.通过作曲家,我能够安装Predis没有问题,然后在尝试运行时:

composer require illuminate/redis

我收到这个错误,这告诉我Composer因为不同的库要求不同的版本而感到困惑illuminate/support,正如我从这个问题中所理解的那样:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: illuminate/support[v5.2.0, v5.1.25].
    - Can only install one of: illuminate/support[v5.2.0, v5.1.25].
    - Can only install one of: illuminate/support[v5.2.0, v5.1.25].
    - illuminate/redis v5.2.0 requires illuminate/support 5.2.* -> satisfiable by illuminate/support[v5.2.0].
    - Installation request for illuminate/redis ^5.2 -> satisfiable by illuminate/redis[v5.2.0].
    - Installation request for illuminate/support == 5.1.25.0 -> satisfiable by illuminate/support[v5.1.25].


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

下面是我的composer.json,这是非常基本的:

{
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework.",
    "keywords": ["framework", "laravel", "lumen"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/lumen-framework": "5.1.*",
        "vlucas/phpdotenv": "~1.0",
        "predis/predis": "^1.0"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0",
        "fzaninotto/faker": "~1.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/"
        ]
    },
    "autoload-dev": {
        "classmap": [
            "tests/"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

我的问题是,我做错了什么?,上面链接的问题建议手动更改来解决这个问题.但我相信设置是如此基本,我应该在这里做错事.



1> Rabea..:

我不得不composer.json用所需的版本编辑文件illuminate/redis; 强制它使用相同的版本,如下所示:

{
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework.",
    "keywords": ["framework", "laravel", "lumen"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/lumen-framework": "5.1.*",
        "vlucas/phpdotenv": "~1.0",
        "predis/predis": "^1.0",
        "illuminate/redis" : "5.1.*"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0",
        "fzaninotto/faker": "~1.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/"
        ]
    },
    "autoload-dev": {
        "classmap": [
            "tests/"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

推荐阅读
云聪京初瑞子_617
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有