getgrav/grav · error · RuntimeException

1

1

Error message

Dependency <cyan>{$package_yaml['name']}</cyan> requires version <cyan>{$dependencyVersion}</cyan>, but <cyan>{$dependency_slug} {$blocked['version']}</cyan> requires {$requires}. Update {$needs} first, then try again.

What it means

Error "Dependency <cyan>{$package_yaml['name']}</cyan> requires version <cyan>{$dependencyVersion}</cyan>, but <cyan>{$dependency_slug} {$blocked['version']}</cyan> requires {$requires}. Update {$needs} first, then try again." thrown in getgrav/grav.

Source

Thrown at system/src/Grav/Common/GPM/GPM.php:1136

                        && !$this->firstVersionIsLower($blocked['version'], $dependencyVersion)) {
                        $needs = [];
                        $gravMin = $this->extractMinConstraintVersion($blocked['grav'] ?? null);
                        if ($gravMin && version_compare($gravMin, GRAV_VERSION, '>')) {
                            $needs['Grav'] = $gravMin;
                        }
                        $phpMin = $this->extractMinConstraintVersion($blocked['php'] ?? null);
                        if ($phpMin && version_compare($phpMin, PHP_VERSION, '>')) {
                            $needs['PHP'] = $phpMin;
                        }

                        if ($needs) {
                            $requires = [];
                            $current = ['Grav' => GRAV_VERSION, 'PHP' => PHP_VERSION];
                            foreach ($needs as $what => $min) {
                                $requires[] = "<cyan>{$what} {$min}</cyan> (you have {$current[$what]})";
                            }

                            throw new RuntimeException(
                                'Dependency <cyan>' . $package_yaml['name'] . '</cyan> requires version <cyan>'
                                . $dependencyVersion . '</cyan>, but <cyan>' . $dependency_slug . ' '
                                . $blocked['version'] . '</cyan> requires ' . implode(' and ', $requires)
                                . '. Update ' . implode(' and ', array_keys($needs)) . ' first, then try again.',
                                1
                            );
                        }
                    }

                    //throw an exception if a required version cannot be found in the GPM yet
                    throw new RuntimeException(
                        'Dependency <cyan>' . $package_yaml['name'] . '</cyan> is required in version <cyan>' . $dependencyVersion . '</cyan> which is higher than the latest release, <cyan>' . $latestRelease . '</cyan>. Try running `bin/gpm -f index` to force a refresh of the GPM cache',
                        1
                    );
                }

                if ($this->firstVersionIsLower($currentlyInstalledVersion, $dependencyVersion)) {
                    $dependencies[$dependency_slug] = 'update';

View on GitHub (pinned to 6040efed04)

When it happens

Trigger: Thrown at system/src/Grav/Common/GPM/GPM.php:1136 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17). Data as JSON: /api/errors/6a2e3acc60856c7f. Report an issue: GitHub.