From 0d304550b5eaf6e9a901a673395f998af319c34a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 22 Nov 2011 11:09:59 +0100 Subject: [PATCH] Clarify error message when packages are not found, fixes #128 --- src/Composer/Command/InstallCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/InstallCommand.php b/src/Composer/Command/InstallCommand.php index 95c95371f..ed10223b1 100644 --- a/src/Composer/Command/InstallCommand.php +++ b/src/Composer/Command/InstallCommand.php @@ -139,7 +139,11 @@ EOT continue 2; } } - throw new \UnexpectedValueException('Package '.$job['packageName'].' could not be resolved to an installable package.'); + + if ($pool->whatProvides($job['packageName'])) { + throw new \UnexpectedValueException('Your version constraint for package '.$job['packageName'].' does not match any existing version, if it only has -dev versions make sure you include -dev in your version constraint.'); + } + throw new \UnexpectedValueException('Package '.$job['packageName'].' was not found in the package pool, check the name for typos.'); } }