2

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.

not solve the problem for : ubuntu so please give me the answers

go get -u github.com/golang/protobuf/{proto,protoc-gen-go}

and

sudo apt install golang-goprotobuf-dev

and

sudo apt-get protobuf-compiler

Yuseferi
  • 7,931
  • 11
  • 67
  • 103
Thiyagu B
  • 21
  • 2

2 Answers2

0

You should be able to:

go install github.com/golang/protobuf/protoc-gen-go@latest

Then:

which protoc-gen-go
/${GOPATH}/bin/protoc-gen-go
DazWilkin
  • 32,823
  • 5
  • 47
  • 88
0

If you haven't already, execute the following:

go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

This will install protoc-gen-go-grpc executable to the location indicated by $GOBIN (default if not set is $GOPATH/bin)

$ ls $(go env GOPATH)/bin | grep 'protoc-gen-grpc-gateway'
protoc-gen-grpc-gateway

The protoc compiler is looking to run this executable, so you'll need to make sure it is resolvable via your $PATH environment variable.

nj_
  • 2,219
  • 1
  • 10
  • 12