我在使用 go get 命令安装 Fabric CA 时遇到错误

I encountered an error while installing Fabric CA with the go get command

执行时

go get -u github.com/hyperledger/fabric-ca/cmd/

我收到以下错误:

go get: installing executables with 'go get' in module mode is deprecated.
Use 'go install pkg@version' instead.   
For more information, see https://golang.org/doc/go-get-install-deprecation
    or run 'go help get' or 'go help install'.
# github.com/hyperledger/fabric-ca/internal/pkg/util
/opt/go/pkg/mod/github.com/hyperledger/fabric-ca@v1.5.2/internal/pkg/util/csp.go:117:12: undefined: bccsp.RSA2048KeyGenOpts
/opt/go/pkg/mod/github.com/hyperledger/fabric-ca@v1.5.2/internal/pkg/util/csp.go:119:12: undefined: bccsp.RSA3072KeyGenOpts
/opt/go/pkg/mod/github.com/hyperledger/fabric-ca@v1.5.2/internal/pkg/util/csp.go:121:12: undefined: bccsp.RSA4096KeyGenOpts
# github.com/hyperledger/fabric-ca/lib/server/operations
/opt/go/pkg/mod/github.com/hyperledger/fabric-ca@v1.5.2/lib/server/operations/system.go:173:23: not enough arguments in call to s.statsd.SendLoop
    have (<-chan time.Time, string, string)
    want (context.Context, <-chan time.Time, string, string)

go版本

go版本go1.17.2linux/amd64

go 1.17.2 不是 fabric-ca 1.5.2 的受支持版本,请在此处查看受支持版本的发行说明 https://github.com/hyperledger/fabric-ca/releases/tag/v1.5.2

然而,依赖项也存在一个问题,该依赖项更改了 api,因此在 go get 上使用 -u 选项意味着它将下载并使用不兼容的版本。这仅适用于服务器,因此对于服务器

go get github.com/hyperledger/fabric-ca/cmd/fabric-ca-server

应该可以,但你也可以

go get github.com/hyperledger/fabric-ca/cmd/...

也包括客户端构建

您当然可以从 https://github.com/hyperledger/fabric-ca/releases/tag/v1.5.2

获取官方版本