{"id":1260,"hash":"e747f486c851b1826704aec5a4972203253d47d3b2eb72415f95703a3cd0bbdb","pattern":"Getting &quot;protoc&quot;: executable file not found in $PATH when running &quot;go generate&quot; command","full_message":"We have an application written in GoLang and we are using GRPC for defining service contracts.\n\nWhen we try to run \"go generate\" command to generate stub from proto file it gives following error:\n\nmain.go:4: running \"protoc\": exec: \"protoc\": executable file not found in $PATH\n\nCommand format in code:\n\n//go:generate protoc -I . --go-grpc_out=. --go_out=.  ./proto/service.proto\n\nNote:\n\nI have already installed protoc-gen-go and protoc-gen-go-grpc\nTried to search for the above error but haven't been able to find a solution yet.","ecosystem":"go","package_name":"protocol-buffers","package_version":null,"solution":"protoc-gen-go and protoc-gen-go-grpc are plugins for protoc. You need to install the protoc (the Protobuf compiler) itself, as explained in Go gRPC - Prerequisites.\n\nSee protobuf - Releases page for a download.\n\nOn a Mac can just use brew install protobuf.","confidence":0.8,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/70935945/getting-protoc-executable-file-not-found-in-path-when-running-go-generate","votes":5,"created_at":"2026-04-19T04:52:44.561187+00:00","updated_at":"2026-04-19T04:52:44.561187+00:00"}