Skip to content
Latchkey

Composer "Could not find package ... did you mean ...?" in CI

Composer searched the configured repositories and found no package by that name. The "did you mean" hint points at the closest known name, which usually reveals a typo. If the package is private, the repository that hosts it may not be configured.

What this error means

composer require or install fails with "Could not find package vendor/nam. Did you mean vendor/name?" or "Could not find a matching version of package X".

Composer
  [InvalidArgumentException]
  Could not find package guzzle/guzzl.
  Did you mean these?
      guzzlehttp/guzzle

Common causes

The package name is misspelled

The vendor or package segment is wrong; the "did you mean" line shows the closest real name on Packagist.

A private package with no configured repository

The name is correct but hosted on a private repository that composer.json does not list, so Composer cannot see it.

How to fix it

Use the exact package name

  1. Compare your require against the "did you mean" suggestion.
  2. Correct the vendor/package name in composer.json.
  3. Re-run the require or install.
Terminal
composer require guzzlehttp/guzzle

Add the private repository

If the name is right but private, declare the repository that hosts it so Composer can find it.

composer.json
{
  "repositories": [
    { "type": "composer", "url": "https://repo.packagist.com/acme/" }
  ]
}

How to prevent it

  • Copy package names from Packagist to avoid typos.
  • Declare private repositories explicitly in composer.json.
  • Commit composer.lock so names are validated before CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →