protoc-gen-go-grpc Error: "Program Not Found or Not Executable"
When attempting to generate GRPC output files from .proto files using the command:
protoc -I ./src/pbdefs/protos/ --go-grpc_out=. src/pbdefs/protos/*.proto
You may encounter the following error:
protoc-gen-go-grpc: program not found or is not executable Please specify a program using absolute path or make sure the program is available in your PATH system variable --go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1.
Solution:
This error indicates that the 'protoc-gen-go-grpc' plugin is missing. To resolve it:
Install the Plugin:
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
Ensure the 'PATH' Environment Variable Includes the Plugin's Location:
Linux/macOS: Add the following line to your '.bashrc' or '.zshrc' file:
export PATH=$PATH:$GOPATH/bin
The above is the detailed content of Why Does `protoc-gen-go-grpc` Fail with 'Program Not Found or Not Executable'?. For more information, please follow other related articles on the PHP Chinese website!