error: The following required arguments were not provided: <path>

2.6k Views Asked by At

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.

enter image description here

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?

1

There are 1 best solutions below

2
On BEST ANSWER

It doesn't tell you to run cargo new. It tells you to run cargo new hello-rust. Look further up in your screenshot. The part you've circled just explains what the cargo new command does. If you look at its manpage, you'll see that it is indeed meant to be invoked as cargo new [OPTIONS] PATH.