Executable file not found in %PATH% when running Terraform fmt -diff

I get this 100% of the time on every Windows server I try to run on. When I run:

terraform fmt -diff

I get:
Error: Failed to generate diff for myfile.tf: exec: “diff”: executable file not found in %PATH%

What am I missing?

Hi @martin9700,

Terraform is trying to run an external command called diff here, but you don’t have that tool installed and so it fails. A typical version of diff is the one inside GNU Diffutils. It looks like GNU Diffutils is available in Chocolatey, which might be a convenient way to install it on Windows, though I’d expect any Windows build of Diffutils to be sufficient here.

1 Like

Thank you! Let me give that a whirl and I’ll report back!

That did it, thank you for the help! Now I have to puppetize all that and get it pushed out!