{"record":{"id":"c64864612e21117b","repo":"GoogleContainerTools/skaffold","slug":"unable-to-lookup-minikube-executable-please-add-i","errorCode":null,"errorMessage":"unable to lookup minikube executable. Please add it to PATH environment variable","messagePattern":"unable to lookup minikube executable\\. Please add it to PATH environment variable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/cluster/minikube.go","lineNumber":143,"sourceCode":"\t\treturn semver.Version{}, err\n\t}\n\tminikubeOutput := map[string]string{}\n\terr = json.Unmarshal(out, &minikubeOutput)\n\tif v, ok := minikubeOutput[\"minikubeVersion\"]; ok {\n\t\tcurrentVersion, err := version.ParseVersion(v)\n\t\tif err != nil {\n\t\t\treturn semver.Version{}, err\n\t\t}\n\t\treturn currentVersion, nil\n\t}\n\treturn semver.Version{}, err\n}\n\nfunc minikubeBinary(ctx context.Context) (string, semver.Version, error) {\n\tfindOnce.Do(func() {\n\t\tfilename, err := exec.LookPath(\"minikube\")\n\t\tif err != nil {\n\t\t\tmk.err = errors.New(\"unable to lookup minikube executable. Please add it to PATH environment variable\")\n\t\t}\n\t\tif _, err := os.Stat(filename); os.IsNotExist(err) {\n\t\t\tmk.err = fmt.Errorf(\"unable to find minikube executable. File not found %s\", filename)\n\t\t}\n\t\tmk.path = filename\n\t\tif v, err := GetCurrentVersionFunc(ctx); err != nil {\n\t\t\tmk.err = versionErr{err: err}\n\t\t} else {\n\t\t\tmk.version = v\n\t\t}\n\t})\n\n\treturn mk.path, mk.version, mk.err\n}\n\ntype versionErr struct {\n\terr error\n}","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/cluster/minikube.go#L125-L161","documentation":"minikubeBinary uses sync.Once to locate the minikube executable via exec.LookPath. If minikube is not on PATH, the cached result is this error, returned whenever a minikube cluster context is needed. The result is memoized, so the error persists for the process lifetime.","triggerScenarios":"Using a kubeconfig context pointing at a minikube cluster (e.g. `skaffold dev --profile` against minikube) while the `minikube` binary is absent from PATH. Also when minikube exists but was removed/moved after PATH changed.","commonSituations":"Fresh machines or CI containers with a leftover minikube kubeconfig but no minikube install; PATH not including ~/bin or /usr/local/bin where minikube lives; switching from Docker Desktop to minikube contexts.","solutions":["Install minikube (e.g. `brew install minikube` or download the binary from the minikube releases)","Add minikube's install directory to PATH: `export PATH=$PATH:/usr/local/bin`","Verify with `which minikube` and `minikube version`","Switch to a non-minikube kube context if minikube is not intended: `kubectl config use-context <other>`"],"exampleFix":"// before (CI Dockerfile)\nRUN kubectl get pods\n// after\nRUN curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \\\n    install minikube-linux-amd64 /usr/local/bin/minikube","handlingStrategy":"fallback","validationCode":"command -v minikube >/dev/null 2>&1 || { echo \"minikube not on PATH\"; exit 1; }\nminikube version","typeGuard":null,"tryCatchPattern":"path, ver, err := minikubeBinary(ctx)\nif err != nil {\n  log.Warnf(\"minikube unavailable (%v); falling back to current kube context\", err)\n  return useDefaultContext(ctx)\n}","preventionTips":["Install minikube on every machine/CI image that uses a minikube kube context","Add minikube's install dir to PATH in shell profiles and CI env","Verify with `which minikube` before running skaffold against minikube","Clean up stale kube contexts pointing at uninstalled minikube clusters"],"tags":["minikube","path","environment","kubernetes","skaffold"],"backgroundTag":"missing-env-var","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}