Skip to content
Latchkey

Cargo "no matching package named" - Fix Missing Crate in CI

Cargo looked for a package by the name in your Cargo.toml and found nothing on the index it searched. The name is wrong, the crate is private, or it is a path/workspace member Cargo cannot see.

What this error means

Resolution fails with no matching package named X found and the location it searched (crates.io index, a registry, or a path). Nothing builds because the dependency cannot be located at all.

cargo output
error: no matching package named `tokio-utils` found
location searched: crates.io index
required by package `app v0.1.0 (/home/runner/work/app)`

Common causes

Misspelled or wrong crate name

The package name on crates.io differs from what you wrote - tokio-util not tokio-utils, or a hyphen/underscore mismatch. Cargo finds nothing matching.

A private or path crate not on the searched index

An internal crate, a workspace member, or a git/path dependency was referenced by a bare name. Without the right path, git, or registry key, crates.io has nothing.

How to fix it

Confirm the exact crate name

Search the registry for the real name and spelling before fixing Cargo.toml.

Terminal
cargo search tokio-util

Point at the right source for private/path crates

Internal crates need an explicit source - a path, a git URL, or a named registry.

Cargo.toml
[dependencies]
shared = { path = "../shared" }
internal = { version = "1.0", registry = "my-registry" }

How to prevent it

  • Copy crate names from crates.io to avoid hyphen/underscore typos.
  • Declare path and registry sources explicitly for non-public crates.
  • Keep workspace member paths correct after moving directories.

Related guides

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