失败:插件grpc-gateway:找不到名为grpc-gateway的protoc插件-

huangapple go评论104阅读模式
英文:

Failure: plugin grpc-gateway: could not find protoc plugin for name grpc-gateway -

问题

在使用"buf generate"生成Prot buff时,我遇到以下错误:

失败:插件grpc-gateway:找不到名为grpc-gateway的protoc插件 - 请确保protoc-gen-grpc-gateway已安装并在您的$PATH中存在

我尝试了以下安装命令:
"go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest;"

英文:

while genrating Prot buff using "buf generate"
i am getting below error :

Failure: plugin grpc-gateway: could not find protoc plugin for name grpc-gateway - please make sure protoc-gen-grpc-gateway is installed and present on your $PATH

i have tried installtion of
"go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest; "

答案1

得分: 2

以下是要翻译的内容:

$ go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

然后检查你的路径,如果没有设置,请使用以下命令:

PATH="${PATH}:${HOME}/go/bin"
英文:
$ go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

then check for your path , if its not set then use below command :

PATH="${PATH}:${HOME}/go/bin" 

答案2

得分: 0

错误是针对protoc-genc-grpc-gateway的,它与proto-gen-go-grpc不同。

请参考安装说明,其中包括protoc-gen-grpc-gateway

你还需要确保插件在你的主机的PATH中。在Linux上,你可以在安装后使用which protoc-gen-grpc-gateway来确认这一点。

英文:

The error is specifically for protoc-genc-grpc-gateway which is distinct from proto-gen-go-grpc.

See the Installation instructions that include protoc-gen-grpc-gateway.

You will also need that the plugin is in your host's PATH. On Linux you can which protoc-gen-grpc-gateway to confirm this after installation.

huangapple
  • 本文由 发表于 2023年2月20日 01:37:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75502123.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定