I am following the Rust getting started guide. I'm in the "Generating a new project" section attempting to generate a "Hello, world!" project by running cargo new
.
However, after running cargo new
I get the following error.
❯ cargo new
error: The following required arguments were not provided:
<path>
USAGE:
cargo new [OPTIONS] <path>
For more information try --help
I am running the command in the /hello-rust
directory as instructed. I've also attempted to run the command in the /hello-rust/src
directory with the same result.
What path do I need to include in my command?
It doesn't tell you to run
cargo new
. It tells you to runcargo new hello-rust
. Look further up in your screenshot. The part you've circled just explains what thecargo new
command does. If you look at its manpage, you'll see that it is indeed meant to be invoked ascargo new [OPTIONS] PATH
.