cannot find module providing package github.com/× working directory is not part of a module
今天在搭建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的更多相关文章
- golang引用第三方包的报错:no required module provides package [完美解决]
关于golang第三方包的引用报错:no required module provides package : go.mod file not found in current directory o ...
- import 本地Python module或package
很基础很重要的一课,虽然很简单,但是防止以后忘了,还是记下来 这个笔记里说的都是import本地的,自己创建的,或者复制粘贴的别人的,总之“不是安装到library”的module or packag ...
- Python工程文件中的名词解释---Module与Package的区别
当我们在已有的Python工程文件中创建新的内容是,通常会有两种类型文件供你选择---Module和Package,对于初学者来说会搞不清楚这两种文件直接的关系.这里就来解释一下这两者之间的关系. M ...
- ABP vue+asp.net core yarn serve报 Cannot find module 'typescript/package.json错误
abp的前端在node install 安装完成了相关的依赖包,直接yarn serve运行相关服务的时候报"Cannot find module 'typescript/package.j ...
- 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 ...
- 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 ...
- python中__init__.py的作用、module和package
控制包的导入行为: 1.声明当前文件是一个可导入的包: 2.如果当下包下有多个.py文件使用__ all__ = [ '模块名'],也就是form XXX import YYY module和pack ...
- 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 ...
- Python Module和Package辨析
Python 基础学习 说明 这不是最基础的新手教程,如需了解Python的数据类型.变量等基础内容,请移步:https://docs.python.org/2/tutorial/index.html ...
随机推荐
- LGP5044口胡
套路题. 对于这一类与 \(\max\) 有关的题,优先考虑笛卡尔树. 建出笛卡尔树,考虑处理以某个点 \(u\) 举办会议时,参加会议的成本. 这里考虑询问区间为 \([1,n]\). 明显 \(u ...
- 『现学现忘』Docker基础 — 28、Docker容器数据卷介绍
目录 1.什么是Docker容器数据卷 2.数据卷的作用 3.数据卷的使用 1.什么是Docker容器数据卷 Docker容器数据卷,即Docker Volume(卷). 当Docker容器运行的时候 ...
- Nginx--sub_filter模块
客户端浏览器访问替换html中的字符: location / { root /web/htdocs; random_index on; index index.html index.htm; subs ...
- 虚拟机Centos安装配置
开始吧~ 新建一个虚拟机 完成后编辑虚拟机 配置内存 处理器: 映像文件: 点击确定完成配置: 开启虚拟机,对操作系统进行配置 输入红线上内容,为计算机选择默认网卡 选择安装时的语言,可选择中文: 设 ...
- RabbitMQ Go客户端教程1——HelloWorld
本文翻译自RabbitMQ官网的Go语言客户端系列教程,本文首发于我的个人博客:liwenzhou.com,共分为六篇,本文是第一篇--HelloWorld. 这些教程涵盖了使用RabbitMQ创建消 ...
- CVE-2010-2861(Adobe ColdFusion 文件读取漏洞)
漏洞介绍 Adobe ColdFusion是美国Adobe公司的一款动态Web服务器产品,其运行的CFML(ColdFusion Markup Language)是针对Web应用的一种程序设计语言. ...
- mac phpstorm返回文件顶部或者底部
在Mac下,请按FN+Command+→|←,就这么简单~
- mq 的缺点 ?
系统可用性降低 系统引入的外部依赖越多,越容易挂掉,本来你就是 A 系统调用 BCD 三个系统的 接口就好了,人 ABCD 四个系统好好的,没啥问题,你偏加个 MQ 进来,万一 MQ 挂了咋整?MQ ...
- final, finally, finalize的区别?
final 用于声明属性,方法和类,分别表示属性不可变,方法不可覆盖,类不可继承.内部类要访问局部变量,局部变量必须定义成final类型.finally是异常处理语句结构的一部分,表示总是执行.fin ...
- springboot-@EventListener简单用法
@EventListener简单描述 简化我们编写监听类的步骤,不需要再继承ApplicationListener接口去实现onApplicationEvent了. 例子: @Component pu ...