Cargo "virtual manifest ... requires a package" in CI
You ran a package-level command (run, install, publish) at a workspace root that has only a [workspace] table and no [package]. Cargo does not know which member to act on, so it refuses.
What this error means
A cargo run, cargo install --path ., or similar fails at the workspace root with "this virtual manifest specifies a [workspace], but no package". The same command works inside a member directory.
error: this virtual manifest specifies a `[workspace]`, but no package.
To run a command on a package, use `cargo <command> -p <package>`,
or run the command from within the package directory.Common causes
Package command at a virtual workspace root
A virtual manifest (only [workspace], no [package]) cannot be the target of a package-scoped command. Cargo has no single package to use.
No default-members declared
Without workspace.default-members, cargo cannot pick a default package for run/build at the root, so it errors instead of guessing.
How to fix it
Name the package with -p
Tell cargo exactly which member to operate on.
cargo run -p my-app
cargo build -p my-app --lockedDeclare default-members in the root
Let cargo pick a default member for root-level commands.
# Cargo.toml (workspace root)
[workspace]
members = ["crates/*"]
default-members = ["crates/my-app"]How to prevent it
- Pass
-p <pkg>for package commands run at a virtual workspace root. - Set
workspace.default-membersso root-levelrun/buildhave a target. - Run member-scoped commands from inside the member directory in CI.