今天在搭建fabric的过程中遇到一个问题,记录一下

 root@zitao /home/hong/Desktop/gowork/src/github.com/hyperledger/fabric release-2.0  make all
Building build/bin/orderer
GOBIN=/home/hong/Desktop/gowork/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=72c79a222 -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
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] 错误 1

google了好久,一直没看出是哪的问题,有的说是没有go.mod

使用命令go mod init

亲测,这个无效。

最后找到一篇 https://studygolang.com/articles/28573

这个上面说,可能是在使用 GOPROXY 的时候,开启了 GO111MODULE,导致包管理非官方所说的在 $GOPATH\src\,而是去了 $GOPATH\src\pkg\目录下,此时就需要用go mod引入这些包 require github.com/gin-gonic/gin@latest ,解决import获取不了包的问题。

所以,我用了一个最笨的方法,直接将GO111MODULE关了

export GO111MODULE=off

问题是解决了,就是有点慢,慢慢等吧,总比一早上就在找上述问题的答案强。

cannot find module providing package github.com/× working directory is not part of a module的更多相关文章

  1. golang引用第三方包的报错:no required module provides package [完美解决]

    关于golang第三方包的引用报错:no required module provides package : go.mod file not found in current directory o ...

  2. import 本地Python module或package

    很基础很重要的一课,虽然很简单,但是防止以后忘了,还是记下来 这个笔记里说的都是import本地的,自己创建的,或者复制粘贴的别人的,总之“不是安装到library”的module or packag ...

  3. Python工程文件中的名词解释---Module与Package的区别

    当我们在已有的Python工程文件中创建新的内容是,通常会有两种类型文件供你选择---Module和Package,对于初学者来说会搞不清楚这两种文件直接的关系.这里就来解释一下这两者之间的关系. M ...

  4. ABP vue+asp.net core yarn serve报 Cannot find module 'typescript/package.json错误

    abp的前端在node install 安装完成了相关的依赖包,直接yarn serve运行相关服务的时候报"Cannot find module 'typescript/package.j ...

  5. Golang通过git clone beego框架报错 error: while accessing https://github.com/astaxie/beego/info/refs fatal: HTTP request failed package github.com/astaxie/beego: exit status 128

    在Centos6.4尝试搭建beego框架,使用git命令clone时报错 # cd .; git clone https://github.com/astaxie/beego /www/projec ...

  6. Go丨语言package github.com/Go-SQL-Driver/MySQL: exec: "git": executable file not found in %PATH%解决方法

    Go语言在添加第三方MySQL驱动的时候报错: go: missing Git command. See https://golang.org/s/gogetcmd package github.co ...

  7. python中__init__.py的作用、module和package

    控制包的导入行为: 1.声明当前文件是一个可导入的包: 2.如果当下包下有多个.py文件使用__ all__ = [ '模块名'],也就是form XXX import YYY module和pack ...

  8. webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-env' from '...' - Did you mean "@babel/env"?

    webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find mo ...

  9. Python Module和Package辨析

    Python 基础学习 说明 这不是最基础的新手教程,如需了解Python的数据类型.变量等基础内容,请移步:https://docs.python.org/2/tutorial/index.html ...

随机推荐

  1. cookie、session和Storage

    概念: cookie:HTTP响应头的一部分,通过name=value的形式存储,主要用于保存登录信息.在设置的cookie过期时间之前一直有效,即使窗口或浏览器关闭. 存放数据大小为4K左右 .有个 ...

  2. LGP4001题解

    题目大意 给定一张无向图,需要消耗代价才能使一条边被[数据删除],求使这张图不连通的最小代价. 一看就是最小割的应用啊... 从 \(u\) 到 \(v\),边权为 \(w\) 的边,建两条:一条从 ...

  3. H3C三层交换机之IRF虚拟化技术详解及配置

    一.IRF是什么? 目前,网络中主要存在两种结构的通信设备,固定盒式设备和模块框式分布式设备. 固定盒式设备成本低廉,但没有高可用性支持:模块框式分布式设备具有高可用性.高性能.高端口密度的优点,但投 ...

  4. 基于Drone+Gogs流水线-全面认识轻量级云原生CI引擎Drone

    1. 介绍 Drone by Harness 是一个基于Docker容器技术的可扩展的持续集成引擎,用于自动化测试.构建.发布.每个构建都在一个临时的Docker容器中执行,使开发人员能够完全控制其构 ...

  5. HIve的基本使用

    WHERE从表中筛选行: SELECT从表中查询指定的列: group by在列上做聚合. -- 假设数据文件的内容,字段之间以ASCII 001(ctrl-A)分隔,行之间以换行分隔. CREATE ...

  6. NET 中反射的用法

    1.   反射的学习 A.反射的定义 B.反射举例 namespace Com.Meteor.Interface { public interface IHelper { void Query(); ...

  7. JavaWeb 10_Filter过滤器

    一.什么是Filter? 1.Filter 过滤器它是JavaWeb的三大组件之一-.三大组件分别是: Servlet 程序.Listener 监听器.Filter 过滤器2.Filter 过滤器它是 ...

  8. Docker——常用命令

    常用命令 docker version # 显示docker的版本信息 docker info # 显示docker的系统信息,包括镜像和容器的数量 docker 命令 --help # 帮助命令,中 ...

  9. vulhub漏洞环境搭建

    (搭建之前建议更换成阿里的源) 在纯净ubuntu中部署vulhub环境: 1.安装docker,并用docker -v命令验证安装结果: curl -s https://get.docker.com ...

  10. file_put_contents利用技巧(php://filter协议)

    Round 1 <?php $content = '<?php exit; ?>'; $content .= $_POST['txt']; file_put_contents($_P ...