操作系统:CentOS 7.7
go 环境如下
```bash
[root@fabrictest fabric]# go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/usr/local/go/bin"
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/data/go-project"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build255904435=/tmp/go-build -gno-record-gcc-switches"
```
```bash
cd /data/go-project/src/github.com/hyperledger/fabric
编译报错信息如下:
[root@fabrictest fabric]# make all
fatal: Needed a single revision
fatal: Needed a single revision
fatal: Needed a single revision
fatal: Needed a single revision
fatal: Needed a single revision
fatal: Needed a single revision
fatal: Needed a single revision
Building build/bin/orderer
GOBIN=/data/go-project/src/github.com/hyperledger/fabric/build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=2.0.2 -X github.com/hyperledger/fabric/common/metadata.CommitSHA= -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger" github.com/hyperledger/fabric/cmd/orderer
can't load package: cannot find module providing package github.com/hyperledger/fabric/cmd/orderer: working directory is not part of a module
make: *** [Makefile:200: build/bin/orderer] Error 1
```
搜索了好多无果,尝试去掉GOBIN设置,报错依旧
这个是哪里的问题呀?求解答·
有疑问加站长微信联系(非本文作者)