但这些与您的要求或最低稳定性相冲突

2022-08-30 10:07:52

我正在创建自己的slackbot。我决定使用project作为一个库来帮助我。

https://github.com/sagebind/slack-client/issues?utf8=%E2%9C%93&q=stability

现在我需要用作曲家安装它。

所以我使用了命令:composer require coderstephen/slack-client

...我得到错误:

 Problem 1
    - Installation request for coderstephen/slack-client ^0.3.0 -> satisfiable by coderstephen/slack-client[v0.3.0].
    - coderstephen/slack-client v0.3.0 requires devristo/phpws dev-master -> satisfiable by devristo/phpws[dev-master] but these conflict with your requirements or minimum-stability.

好的 - 所以我决定在我的:composer.lock

"aliases": [],
    "minimum-stability": "dev",
    "stability-flags": {
        "devristo/phpws": 20
    },
    "prefer-stable": true,
    "prefer-lowest": false,
    "platform": {
        "php": ">=5.5"
    },
    "platform-dev": []

现在我已经没有关于该怎么做的想法了。自述文件说要在 composer.json 中执行此步骤,但是,不存在这样的设置:

请注意,当前版本具有不稳定的依赖项。

为了安装这些依赖项,您可以在 composer.json 中设置“最小稳定性”,并建议您设置“prefer-stable”:

My composer.json:

{
    "name": "coderstephen/slack-client",
    "keywords": ["slack", "api", "realtime"],
    "license": "MIT",
    "description": "A better Slack client, with RTM API support",
    "authors": [{
        "name": "Stephen Coakley",
        "email": "me@stephencoakley.com"
    }],
    "require": {
        "php": ">=5.5",
        "devristo/phpws": "dev-master",
        "evenement/evenement": "2.0.*",
        "guzzlehttp/guzzle": "~6.0",
        "react/event-loop": "^0.4.1",
        "react/promise": "^2.2"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.6",
        "fzaninotto/faker": "~1.4",
        "apigen/apigen": "^4.1"
    },
    "autoload": {
        "psr-4": {
            "Slack\\": "src"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Slack\\Tests\\": "tests"
        }
    }
}

有谁知道我可以尝试的一些解决方案?


答案 1

添加和到您的(不是):minimum-stabilityprefer-stablecomposer.jsoncomposer.lock

{
    "name": "coderstephen/slack-client",
    "keywords": ["slack", "api", "realtime"],
    "license": "MIT",
    "description": "A better Slack client, with RTM API support",
    "authors": [{
        "name": "Stephen Coakley",
        "email": "me@stephencoakley.com"
    }],
    "require": {
        "php": ">=5.5",
        "devristo/phpws": "dev-master",
        "evenement/evenement": "2.0.*",
        "guzzlehttp/guzzle": "~6.0",
        "react/event-loop": "^0.4.1",
        "react/promise": "^2.2"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.6",
        "fzaninotto/faker": "~1.4",
        "apigen/apigen": "^4.1"
    },
    "autoload": {
        "psr-4": {
            "Slack\\": "src"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Slack\\Tests\\": "tests"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

答案 2

对于遇到相同问题的其他人,最好使用 composer 本身完成这些更改,而不是手动修改 composer.json 文件。只需在控制台中运行以下命令:

$ composer config minimum-stability dev

$ composer config prefer-stable true

现在,您可以要求并更新程序包:

$ composer require --no-update "vendor/package-name:version"

$ composer update

可用选项(按稳定性排序)包括 dev、alpha、beta、RC 和 stable。


推荐