Skip to content

/errors/cargo/could-not-find-cargo-toml

error: could not find `Cargo.toml` in `...` or any parent directory

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
Cargo 1.x
os
any

error: could not find Cargo.toml in <dir> or any parent directory means Cargo looked for a package manifest in the current folder and in every folder above it, and found none. Cargo commands such as build, run and test need to run inside a package. cd into the project, pass --manifest-path, or create a package with cargo new or cargo init.

Reproduce it

bash
cargo build
echo "exit status: $?"

Output

error: could not find `Cargo.toml` in `/tmp/work` or any parent directory
exit status: 101

Cargo searches upwards, so running it in a subfolder of a package (such as src/) works; only folders outside every package fail.

Fixes

bash
cargo new -q --vcs none hello
cargo run -q --manifest-path hello/Cargo.toml
cd hello/src && cargo run -q

Output

Hello, world!
Hello, world!
SituationFix
You are in the parent foldercd NAME, or cargo build --manifest-path NAME/Cargo.toml
Sources exist, no manifestcargo init in that folder
New projectcargo new NAME
Workspace membercargo build -p MEMBER from the workspace root

Sources