'Composer stating requirements not met

I have a simple composer package with the following require:

{
    "require": {
        "vlucas/phpdotenv": "^5.4",
        "wp-cli/wp-cli-bundle": "^2.6"
    }
}

When I run the app, I get the following error:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".

Looking at the composer.json of each package, the current version of PHP I am using (7.4) should be viable. (I have to use 7.4 as one WP plugin breaks with php >8).

Dotenv reports:

"require": {
        "php": "^7.1.3 || ^8.0",
...

and wp-cli-bundle reports:

    "require": {
        "php": ">=5.6",
...

Confused as to why I am getting error issue.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source