执行命令”go install github.com/dmacvicar/terraform-provider-libvirt@latest”时出现错误。

huangapple go评论105阅读模式
英文:

go install github.com/dmacvicar/terraform-provider-libvirt@latest - shows error

问题

我正在尝试使用Terraform在KVM上创建虚拟机。
安装过程中的一步是通过以下命令下载和安装提供程序:

go install github.com/dmacvicar/terraform-provider-libvirt@latest

但是出现了错误:

提供命名包的模块的go.mod文件包含一个或多个替换指令。它不能包含导致其与主模块解释方式不同的指令。

我没有找到解决办法,有人遇到过这个问题吗?
谢谢。

英文:

I am trying to Provision VMs on KVM with Terraform.
one of the steps in installations is to download and install the provider buy the command:

go install github.com/dmacvicar/terraform-provider-libvirt@latest

but it errors:

The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause it to be interpreted differently than if it were the main module.

I didn't find a solution, is someone has faced it?
thank you

答案1

得分: 11

根据JimB在评论中的提醒:

如果模块中有替换或排除指令,正确的安装方法是克隆源代码并进行安装,

git clone github.com/dmacvicar/terraform-provider-libvirt
cd terraform-provider-libvirt
go install
英文:

As JimB notice in comments:

> If there are replace or exclude directives in the module, the correct
> installation method is to clone the source and install it,

git clone github.com/dmacvicar/terraform-provider-libvirt
cd terraform-provider-libvirt
go install

huangapple
  • 本文由 发表于 2021年11月2日 16:13:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/69807151.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定