/errors/cargo/no-matching-package-named-found
Cargo: error: no matching package named `serde-jsonn` found
verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · cargo 1.98.1 (797e8a9bc 2026-08-05)updated
- tool
- Cargo
- exit code
- 101
- versions
- Rust 1.x
- os
- any
error: no matching package named serde-jsonn found means Cargo searched the registry index (crates.io unless told otherwise) for the crate named in Cargo.toml and no crate with that name exists there. Cargo also prints location searched: (the index it looked in) and required by package (the crate that declares the dependency). Fix the name, usually a typo, or point the dependency to the right source with registry =, path = or git =.
Reproduce it
mkdir -p src
cat > Cargo.toml <<'EOF'
[package]
name = "demo"
version = "0.1.0"
edition = "2021"
[dependencies]
serde-jsonn = "1"
EOF
echo 'fn main() {}' > src/main.rs
cargo build 2>&1 | grep -v 'Updating'
exit "${PIPESTATUS[0]}"Output · exit 101
error: no matching package named `serde-jsonn` found location searched: crates.io index required by package `demo v0.1.0 (/tmp/work)`
Fix
Correct the name (serde_json). cargo add checks the registry and writes the name and a valid version for you:
mkdir -p src
cat > Cargo.toml <<'EOF'
[package]
name = "demo"
version = "0.1.0"
edition = "2021"
[dependencies]
EOF
echo 'fn main() {}' > src/main.rs
cargo add serde_json@1.0.128 -q
grep serde_json Cargo.tomlOutput
serde_json = "1.0.128"
| Crate source | Dependency in Cargo.toml |
|---|---|
| crates.io | serde_json = "1" |
| Private registry | mycrate = { version = "1", registry = "company" } |
| Folder in the same repo | mycrate = { path = "../mycrate" } |
| Git repository | mycrate = { git = "https://example.com/org/mycrate.git" } |
Sources
Related pages
commands · cargocargo add serde --features derive: add a dependency with featurescargo add NAME --features F adds a crate to Cargo.toml with chosen features (Cargo 1.62+). Pin versions, dev and build deps, default features, and cargo remove.errors · cargoerror: could not find `Cargo.toml` in `...` or any parent directorycargo reports could not find Cargo.toml when run outside a Rust package. cd into the project, pass --manifest-path, or create a package with cargo new.errors · cargoCargo: error: current package believes it's in a workspace when it's notcargo build fails with current package believes it's in a workspace when a parent Cargo.toml has [workspace] without it. Add it to members or exclude it.