phpcomposer-phpgoogle-authenticator

Composer - The requested package phpgangsta/googleauthenticator 1.0.1 exists as [dev-master] but these are rejected by your constraint


I need to install https://github.com/PHPGangsta/GoogleAuthenticator but if I run composer require "PHPGangsta/GoogleAuthenticator:1.0.1" I get an error:

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

Problem 1 - The requested package phpgangsta/googleauthenticator 1.0.1 exists as phpgangsta/googleauthenticator[dev-master] but these are rejected by your constraint.

Here is composer.json where is only restriction for PHP version.

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

Can somebody explain me please what is the problem?


Solution

  • I think there is not available the 1.0.1 version from the package.
    When you run the composer show --available phpgangsta/googleauthenticator command then you can see there the possible versions but there is only the dev-master.
    And this version is not a stable version. Composer wants to install only stable versions from packages defaultly, but there is not.
    So if you want to use this in your project then need to install with composer require --prefer-dist phpgangsta/googleauthenticator:dev-master command.