gpt4 book ai didi

go - 错误消息 :protoc-gen-go: Plugin failed with status code 1

转载 作者:行者123 更新时间:2023-12-01 20:25:42 24 4
gpt4 key购买 nike

这不是重复的问题

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

  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

看协议(protocol):
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.

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

最佳答案

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

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

关于go - 错误消息 :protoc-gen-go: Plugin failed with status code 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59212794/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com