Composer - 请求的包 phpgangsta/googleauthenticator 1.0.1 作为 [dev-master] 存在,但这些被您的约束拒绝了

问题描述 投票:0回答:2

我需要安装https://github.com/PHPGangsta/GoogleAuthenticator但是如果我运行composer require "PHPGangsta/GoogleAuthenticator:1.0.1"我会收到错误:

您的要求无法解决为一组可安装的 包裹。

问题1 - 请求的包 phpgangsta/googleauthenticator 1.0.1 存在为 phpgangsta/googleauthenticator[dev-master] 但这些是 被你的约束拒绝了。

这里是composer.json,其中仅对PHP版本有限制。

{
    "require": {
        "php": ">=5.6.1",
        "league/oauth1-client": "^1.7",
        "mongodb/mongodb": "^1.3",
        "ruflin/elastica": "^5.3"
    }
}

有人可以解释一下我出了什么问题吗?

php composer-php google-authenticator
2个回答
5
投票

我认为软件包中没有

1.0.1
版本。
当您运行
composer show --available phpgangsta/googleauthenticator
命令时,您可以看到可能的版本,但只有
dev-master

而且这个版本还不是稳定版本。 Composer 默认只想安装软件包中的稳定版本,但没有。
因此,如果您想在项目中使用它,则需要使用
composer require --prefer-dist phpgangsta/googleauthenticator:dev-master
命令安装。


0
投票

不适用于 php8。 问题1 - phpunit/phpunit[6.0.0, ..., 6.5.14] 需要 php ^7.0 -> 你的 php 版本 (8.0.13) 不满足该要求。 - 根 Composer.json 需要 phpunit/phpunit ~6 -> 可通过 phpunit/phpunit[6.0.0, ..., 6.5.14] 满足。

© www.soinside.com 2019 - 2024. All rights reserved.