Search code examples
phpsymfonycomposer-phpsymfony4semantic-versioning

Unable to install symfony/console:3.2 via composer and flex


I have a Symfony 4 project and am trying to install this package for working with AWS DynamoDB.

When I run composer require oasis/dynamodb-odm I get an error saying oasis/dynamodb-odm v0.5.3 requires symfony/console ^3.2 -> no matching package found. Attempting to run composer require symfony/console:^3.2 also results in the "Could not find package..." error.

As I am using Symfony 4, composer commands are intercepted by Symfony Flex and some extra stuff happens. Interestingly, there is a Flex recipe for symfony/console:3.3 but not 3.2 which I imagine might be the problem.

My understanding of the caret is that it should allow minor version bumps, so I wonder why console v3.3 is not installed instead.

I would like to use this package, and there aren't many DynamoDB PHP offerings out there, so how can I resolve this issue?


Solution

  • if you checkout the composer.json file of the package, you can see the following

    "require"     : {
            "php"                 : ">=5.6",
            "doctrine/annotations": "^1.4",
            "oasis/aws-wrappers"  : "^2.10",
            "oasis/logging"       : "^1.0",
            "doctrine/common"     : "^2.7",
            "symfony/console"     : "^3.2",
            "symfony/finder"      : "^3.2"
        },
    

    meaning it is compatible with symfony3 only.

    Probably you can fork the repo and try changing the version numbers and test it. If it works you can install it.