运行下面的命令来构建hyperledger,一段时间后,我在我的终端中看到以下错误
$ make dist-clean all
build/bin/peer
CGO_CFLAGS=" " GOBIN=/usr/share/go-1.6/src/github.com/hyperledger/fabric/build/bin go install -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=0.7.0-snapshot-29d7fc0 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.0 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric" github.com/hyperledger/fabric/peer
/usr/lib/go-1.6/src/github.com/hyperledger/fabric/core/chaincode/ccproviderimpl.go:20:2: cannot find package "context" in any of:
/usr/lib/go-1.6/src/github.com/hyperledger/fabric/vendor/context (vendor tree)
/usr/lib/go-1.6/src/vendor/context
/usr/share/go/src/github.com/hyperledger/fabric/vendor/context
/usr/share/go/src/vendor/context
/usr/lib/go-1.6/src/context (from $GOROOT)
/usr/share/go/src/context (from $GOPATH)
Makefile:177: recipe for target 'build/bin/peer' failed
make: *** [build/bin/peer] Error 1发布于 2017-03-07 00:34:01
构建和测试fabric的方法如此之多,以至于您需要为这个问题提供一些上下文,才能有机会得到回答。
但是,为了缩短这个过程,请允许我提供一些有用的文档,在尝试使用最新的fabric代码之前应该先阅读这些文档:
https://github.com/hyperledger/fabric/blob/master/docs/source/install_instantiate.rst
https://github.com/hyperledger/fabric/blob/master/docs/source/dev-setup/build.rst
发布于 2018-02-15 18:49:39
问题与此有关:#23672它会影响Go版本1.8.7、1.9.4和1.10rc2
我将golang版本从1.9.4降级到1.9,这对我来说是有效的。
发布于 2017-03-28 21:15:02
更新您的golang版本,1.7.0+可能会有所帮助。
https://stackoverflow.com/questions/42600686
复制相似问题