Rustfmt: Cannot install on Windows stable (or nightly!)

Created on 31 Jan 2019  路  3Comments  路  Source: rust-lang/rustfmt

I'm unable to install rustfmt on Windows on either stable or nightly, but I am able to install rustfmt-preview. I'm using a couple tools (cargo-expand, mostly) that have asked me to install rustfmt, but the commands they give me don't work.

$ rustup self update
info: checking for self-updates

$ rustup --version
rustup 1.16.0 (beab5ac2b 2018-12-06)

$ rustup component add rustfmt
error: toolchain 'stable-x86_64-pc-windows-msvc' does not contain component 'rustfmt' for target 'x86_64-pc-windows-msvc'

$ rustup component add rustfmt --toolchain nightly
error: toolchain 'nightly-x86_64-pc-windows-msvc' does not contain component 'rustfmt' for target 'x86_64-pc-windows-msvc'

Most helpful comment

That worked, thanks!

Is there an existing tracking issue for rustup for trying to figure out what could be causing this kind of issue?

All 3 comments

Could you please try removing toolchains, then reinstall them?

# e.g. reinstalling stable
rustup toolchain remove stable
rustup toolchain install stable
rustup component add rustfmt --toolchain stable

That worked, thanks!

Is there an existing tracking issue for rustup for trying to figure out what could be causing this kind of issue?

Not that I am aware of.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

0x7CFE picture 0x7CFE  路  5Comments

MoSal picture MoSal  路  5Comments

BartMassey picture BartMassey  路  4Comments

Julian-Wollersberger picture Julian-Wollersberger  路  5Comments

alatiera picture alatiera  路  4Comments