'cargo' binary normally provided by the 'cargo' component is not applicable to the 'nightly

Hi all, I am building a project with cargo nightly recently, and I got this error

This is my rustup version: 1.24.3

Also we override the toolchain with rust-toolchain file:

channel = "nightly-2021-06-09"
components = [ "rustc-dev", "llvm-tools-preview" ]
profile = "minimal"

I've tried uninstall and install nightly but it doesn't work, it's weird that if I run rustup component remove cargo' then I get no such file error but when I run rustup component add cargo` I get the info suggest my cargo is installed and up to date.

Any help is great!

Is there any reason you can't bump the nightly? The component clearly isn't available and that's not going to change for an old version.

1 Like

Sorry about the late response, I am not entirely sure what you mean by bumping the nightly. I've tried uninstall and install nightly through rustup a couple of times but that doesn't help.

Not all nightly versions have all components pre-built. You need to choose a date other than nightly-2021-06-09.

It's really strange that the nightly might be released without the core component, however. And, according to availability page, Cargo was available in the mentioned nightly.

Oh I think I got it, the source of the issue is actually in the build process where I am syncing up the toolchain channel and installing the components. When I did that, the cargo component installation for nightly seems to break down and thus block the later use. I removed the toolchain and try a full build of my project today and seems like the problem is solved. But thanks to everyone's help!!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.