在执行fabric++源码编译时,出现以下问题:

直接make,报错

can't load package: cannot find module providing package github.com/hyperledger/fabric/core/chaincode/shim: working directory is not part of a module
.build/bin/peer
CGO_CFLAGS=" " GOBIN=/root/go/src/github.com/hyperledger/fabric/.build/bin go install -tags "experimental" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.2.0 -X github.com/hyperledger/fabric/common/metadata.CommitSHA=bef689d -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.4.10 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.Experimental=true" github.com/hyperledger/fabric/peer
can't load package: cannot find module providing package github.com/hyperledger/fabric/peer: working directory is not part of a module
make: *** [.build/bin/peer] Error 1

我又试了一下

go mod init   又出现新的问题

[root@installnode fabric]# git config --global http.proxy
[root@installnode fabric]# git config --global --unset http.proxy
[root@installnode fabric]# go mod init
go: creating new go.mod: module github.com/hyperledger/fabric
go: copying requirements from Gopkg.lock
go: converting Gopkg.lock: stat golang.org/x/sync@1d60e4601c6fd243af51cc01ddf169918a5407ca: unrecognized import path "golang.org/x/sync": https fetch: Get "https://golang.org/x/sync?go-get=1": dial tcp 142.251.42.241:443: i/o timeout
go: converting Gopkg.lock: stat github.com/hashicorp/go-version@4fe82ae3040f80a03d04d2cccb5606a626b8e1ee: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /root/go/pkg/mod/cache/vcs/55a07af7a5aae7cb8a6ac0855c55376f93f703c3f4fca97129b1aa150a83a52e: exit status 128:fatal: unable to access 'https://github.com/hashicorp/go-version/': Failed connect to github.com:443; Connection timed out
go: converting Gopkg.lock: stat github.com/spf13/cobra@v0.0.1: unknown revision v0.0.1
go: converting Gopkg.lock: stat google.golang.org/genproto@df60624c1e9b9d2973e889c7a1cff73155da81c4: unrecognized import path "google.golang.org/genproto": https fetch: Get "https://google.golang.org/genproto?go-get=1": dial tcp 172.217.160.113:443: i/o timeout
go: converting Gopkg.lock: stat github.com/miekg/pkcs11@6dbd569b952ec150d1425722dbbe80f2c6193f83: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /root/go/pkg/mod/cache/vcs/cf5d61340771573aed6ee8c4275f2b4f1bb12692808bba89497ec8e4888b8fb3: exit status 128:fatal: unable to access 'https://github.com/miekg/pkcs11/': Empty reply from server
go: converting Gopkg.lock: stat github.com/pierrec/lz4@2fcda4cb7018ce05a25959d2fe08c83e3329f169: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /root/go/pkg/mod/cache/vcs/036595127a116abca3f2bfd7bedafedb33d890c2b102d96361815966679432e7: exit status 128:fatal: unable to access 'https://github.com/pierrec/lz4/': Empty reply from server
go: converting Gopkg.lock: stat github.com/prometheus/client_golang@v0.8.0: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /root/go/pkg/mod/cache/vcs/6ffa6057942360db9e438bbc1bc03e3efd3ae1d41df4abeb5328ef376a815bfa: exit status 128:error: RPC failed; result=7, HTTP code = 0fatal: The remote end hung up unexpectedly
go: converting Gopkg.lock: stat github.com/eapache/go-xerial-snappy@bb955e01b9346ac19dc29eb16586c90ded99a98c: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /root/go/pkg/mod/cache/vcs/d6e4eb9c4ce7763510368de51f2ac8ad1f1445d3b0a7997817cc35c74f0f3f7f: exit status 128:fatal: unable to access 'https://github.com/eapache/go-xerial-snappy/': Failed connect to github.com:443; Connection timed out
go: converting Gopkg.lock: stat golang.org/x/text@v0.3.0: unrecognized import path "golang.org/x/text": https fetch: Get "https://golang.org/x/text?go-get=1": dial tcp 172.217.160.113:443: i/o timeout
go: converting Gopkg.lock: stat github.com/BurntSushi/toml@v0.3.0: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /root/go/pkg/mod/cache/vcs/ec7059c73d3b4ffc04ddf6278ca6c81ff16e45641dec2d453a2a830539c590c8: exit status 128:fatal: unable to access 'https://github.com/BurntSushi/toml/': Encountered end of file
go: converting Gopkg.lock: stat golang.org/x/crypto@21652f85b0fdddb6c2b6b77a5beca5c5a908174a: unrecognized import path "golang.org/x/crypto": https fetch: Get "https://golang.org/x/crypto?go-get=1": dial tcp 172.217.24.17:443: i/o timeout
^C
[root@installnode fabric]# go build --tags nopkcs11
go: cannot find main module, but found Gopkg.lock in /root/go/src/github.com/hyperledger/fabricto create a module there, run:go mod init
[root@installnode fabric]# go build
go: cannot find main module, but found Gopkg.lock in /root/go/src/github.com/hyperledger/fabricto create a module there, run:go mod init

原来当目录下没有go.mod的时候,不使用go mod构建

最终解决办法:禁用go mod,命令如下

export  GO111MODULE=auto

can‘t load package: cannot find module providing package github.com/hyperledger/fabric/core/chaincod相关推荐

  1. Go1.13:使用go mod 管理依赖, 提示cannot find module providing package或cannot find main module

    问题现象 编译go程序的时候报错: GOROOT=D:\go\GoSDK #gosetup GOPATH=D:\hc\workspace\fly\go\src\github.com\learngo;D ...

  2. go build 编译报错 missing go.sum entry for module providing package

    go build 编译报错 missing go.sum entry for module providing package 解决方法 // 移除未使用的依赖 go mod tidy 再次编译,就可 ...

  3. go出现missing go.sum entry for module providing package 错误

    文章目录 前言 问题分析 解决方法 前言 从github下载了别人的代码后直接执行,报missing go.sum entry for module providing package错误 问题分析 ...

  4. go语言单元测试报错:missing go.sum entry for module providing package github.com/stretchr/testify/assert

    报错:missing go.sum entry for module providing package github.com/stretchr/testify/assert (imported by ...

  5. Error: error getting chaincode bytes: ‘go list‘ failed with: cannot find module providing package

    执行打包命令: peer lifecycle chaincode package sacc.tar.gz –path github.com/hyperledger/fabric-cluster/cha ...

  6. missing go.sum entry for module providing package

    1.启动报错信息: xxxxx missing go.sum entry for module providing package xxxxxxxx 解决方案: go mod tidy 2.go mo ...

  7. cannot find module providing package

    cannot find module providing package github.com/gorilla/websocket: working directory is not part of ...

  8. 【go modules】missing go.sum entry for module providing package

    问题描述: go get 下载第三方包采用module 管理包一般会放在pkg/mod 下面,那么如何自动管理包,以及导入包呢? go get github.com/gin-gonic/gin imp ...

  9. [Go] 解决main.go:5:2: missing go.sum entry for module providing package github.com/astaxie/beego

    当在代码中使用了第三方库 ,但是go.mod中并没有跟着更新的时候 如果直接run或者build就会报这个错误 main.go:5:2: missing go.sum entry for module ...

最新文章

  1. 一文看懂AI数据采集标注未来三年的发展和趋势
  2. 同一台服务器,mysql登录不了指定端口的问题
  3. 显卡在电脑什么位置_显卡是什么?电脑显卡有什么用?——《作用篇》
  4. python37安装opencv41_Vs2019+opencv4.1.0+python3.7,包安装,vs2019opencv410python37,程序包
  5. Node.js实现Excel转JSON
  6. selenium 验证码——万能码的使用
  7. Asp.net Request方法获取客户端的信息
  8. css3禅密花园叫什么名字_CSS秘密花园:灵活的椭圆形
  9. range函数--python内置函数
  10. 作为一名菜鸟的学习分享
  11. vue清除路由历史记录
  12. SYN 包(synchronize)
  13. Zabbix 网页端监控工具
  14. 「转录组」WGCNA实战原理两不误
  15. python nextpow2_Python signal.hann方法代码示例
  16. MybatisPlus实现多条件拼接动态查询
  17. android如何实现用户注册功能,Android 实现简单的登录注册功能(SharedPreferences和SQLite)...
  18. 数据分析八大模型:详解PEST模型
  19. SuperMap iClient3D for Cesium视频投放
  20. CTP协议的组成原理与具体实现(实验篇,含代码)_物联网竞赛挑战赛

热门文章

  1. Windows+L键不能锁屏解决方案
  2. 宏碁收购Gateway 12天上演变脸大戏
  3. 异地工作比例高 最受IT人欢迎的十大工作城市
  4. Gmailnbsp;邮箱登陆慢打不开和如何成功…
  5. 计算机中的数制与编码教程,第一章计算机中的数据和编码教程.doc
  6. 第三部,雨荨云海婚后故事概要
  7. 斯蒂夫乔布斯传札记:第五波
  8. 如何获取sku详情信息
  9. Python数据分析之制作全球地震散点图:JSON格式
  10. SIMPLIS仿真软件2.2-SIMPLIS快速入门2