我在尝试安装 buffalo 时遇到错误。
我在 go version go1.12.7 linux/amd64
上使用干净的 GOPATH 进行了测试,其中没有任何内容。 GO111MODULE
设置为on
。
我尝试使用网站上给出的命令安装 buffalo:
go get -u -v github.com/gobuffalo/buffalo/buffalo
执行命令导致返回代码 1
,详细输出末尾的错误消息似乎是 go get: error loading module requirements
。
不用 -u
试试。这对我有用:
$ cd $(mktemp -d)
$ go mod init example.com/tempmod
$ go get github.com/gobuffalo/buffalo/buffalo
这些步骤对你有用吗?
更多关于 -u
来自 modules wiki :
A common mistake is thinking go get -u foo
solely gets the latest version of foo. In actuality, the -u
in go get -u foo
or go get -u foo@latest
means to also get the latest versions for all of the direct and indirect dependencies of foo. A common starting point when upgrading foo is instead to do go get foo
or go get foo@latest
without a -u
(and after things are working, consider go get -u=patch foo
, go get -u=patch
, go get -u foo
, or go get -u
).
此外,对于您的原始命令,您很可能会在输出的较早部分看到更具体的错误。如果您在运行时没有使用 -v
来降低噪音,然后忽略“发现”、“下载”和“提取”消息,则可能存在更具体的错误。