Cargo "no matching package named" - Fix Missing Crate in CI
By Daniel Zoghalchali·Latchkey
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)`
Diagnose it: toolchain, features, or a stale target dir?
Cargo failures that only appear in CI are usually a different toolchain channel, a different feature set resolved by the dependency graph, or a target directory restored from a cache built with different flags.
Terminal
rustc --version --verbose
cargo --version
cat rust-toolchain.toml 2>/dev/null
# which features actually got enabled across the graph?
cargo tree -e features | head -40
# rule out a poisoned cache before anything else
cargo clean && cargo build --locked
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.
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.
Frequently asked questions
What causes Cargo "no matching package named"?
There are 2 common causes: misspelled or wrong crate name and a private or path crate not on the searched index. The package name on crates.io differs from what you wrote - tokio-util not tokio-utils, or a hyphen/underscore mismatch.
How do I fix Cargo "no matching package named"?
There are 2 fixes depending on which cause you have: confirm the exact crate name and point at the right source for private/path crates. Work through them in order, since the first is the most common.
What does Cargo "no matching package named" actually mean?
Resolution fails with no matching package named X found and the location it searched (crates.io index, a registry, or a path).
How do I stop Cargo "no matching package named" happening again?
Copy crate names from crates.io to avoid hyphen/underscore typos. The prevention section lists 3 changes that keep it from recurring.