当前位置: 首页 > 知识库问答 >
问题:

错误消息:proc-gen-go:插件失败,状态代码为1

闻人嘉木
2023-03-14

这不是重复的问题

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

  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

已安装:go get-u google。戈朗。组织/grpc

外观原型:

czxmac:~ chezixin$ protoc --version
libprotoc 3.11.1

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

去找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.

哪里有问题,请掌握指导。

共有1个答案

鲁鹏
2023-03-14

此问题与PATH变量有关,请重新设置。我可以在这行PATH变量中看到一个额外的尾随撇号(')的拼写错误/用户/车资信/转到:/Users/chezixin/go/bin':

尝试将其更新为 /Users/chezixin/go:/用户/chezisin/go/bin:

 类似资料: