kubectl diff on windows returns an error: executable file not found in PATH

10/15/2019

I have a problem using Kubectl on Windows:

C:\> kubectl diff -f app.yml
error: executable file not found in %PATH%

Kubernetes is installed with the Docker Desktop. The same error comes independent of the file, I'm using as an argument (even if the .yml file doesn't contain anything).

Version:

C:\> kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.6", GitCommit:"96fac5cd13a5dc064f7d9f4f23030a6aeface6cc", GitTreeState:"clean", BuildDate:"2019-08-19T11:05:16Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
-- Dennis Meissel
docker-desktop
kubernetes
windows

3 Answers

12/26/2019

Try to install using choco - no need to restart Windows.

choco install diffutils
-- Andrey Dimarov
Source: StackOverflow

10/16/2019

After installing DiffUtils for Windows on my local machine and restarting the machine everything works.

-- Dennis Meissel
Source: StackOverflow

10/15/2019

The kubectl diff command uses the Unix diff program under the hood. Presumably you don't have this installed. You can probably install it through WSL or your other favorite way to get Unix-y programs.

-- coderanger
Source: StackOverflow