【问题标题】:Error message:protoc-gen-go: Plugin failed with status code 1错误消息:protoc-gen-go:插件失败,状态码为 1
【发布时间】:2020-03-31 10:14:17
【问题描述】:

这不是重复的问题

首先,我确定我有以下配置:

  1 export GOPATH=/Users/chezixin/go
  2 export GOBIN=/Users/chezixin/go/bin
  3 
  4 export GO111MODULE=on
  5 # 123
  6 export GOPROXY=https://goproxy.cn
  7 
  8 
  9 export PATH="$PATH:/Applications/Postgres.app/Contents/Versions/12/bin:/Users/chezixin/flutterSDK/flutter/bin:/usr/local/go/bin:$GOPATH:$GOBIN"
 10


 czxmac:~ chezixin$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:
/sbin:/Applications/VMwareFusion.app/Contents/Public:
/Applications/Postgres.app/Contents/Versions/latest/bin:
/Applications/Postgres.app/Contents/Versions/12/bin:
/Users/chezixin/flutterSDK/flutter/bin:/usr/local/go/bin:
/Users/chezixin/go:/Users/chezixin/go/bin':
/Users/chezixin/Go/bin:/Applications/Postgres.app/Contents/Versions/12/bin:
/Users/chezixin/flutterSDK/flutter/bin:
/usr/local/go/bin:/Users/chezixin/go:
/Users/chezixin/go/bin:/Users/chezixin/Go/bin

已安装: 去获取 -u google.golang.org/grpc

看协议:

czxmac:~ chezixin$ protoc --version
libprotoc 3.11.1

Protoc-gen-go 已安装并存在于 $GOPATH/bin 中

go get -u github.com/golang/protobuf/protoc-gen-go

问题: 当我执行以下命令时

$ protoc --go_out=plugins=grpc:. *.proto

发生错误:

protoc-gen-go: 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_out: protoc-gen-go: Plugin failed with status code 1.

问题出在哪里,请高手指点。

【问题讨论】:

    标签: go grpc


    【解决方案1】:

    此问题与您的 PATH 变量有关,请重新设置。 我可以在 PATH 变量的这一行中看到 额外的尾随撇号(') 的错字。 /Users/chezixin/go:/Users/chezixin/go/bin':

    尝试将其更新为 /Users/车子心/go:/Users/车子心/go/bin:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-28
      • 2021-02-25
      • 1970-01-01
      • 2017-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多