简体   繁体   English

在 Windows 上使用 go mod 安装 go buffalo 有困难

[英]Difficulty installing go buffalo using go mod on windows

I am very new to golang.我对 golang 很陌生。 I am trying to work with the gomod.我正在尝试使用 gomod。 Trying to explore the go buffalo framework.尝试探索 go buffalo 框架。 But finding a bit of difficulty in installing that.但是发现安装它有点困难。

What I have done:我做了什么:

  1. I saw that go get is nomore supported for buffalo and so switched to go modules.我看到 buffalo 不再支持 go get,因此切换到 go 模块。

  2. Created a module by go mod init github.com/webbuffalotest通过go mod init github.com/webbuffalotest创建了一个模块

  3. Fetched go get -v github.com/gobuffalo/buffalo (on the same directory where I have go.mod file)获取go get -v github.com/gobuffalo/buffalo (在我拥有 go.mod 文件的同一目录中)

  4. Fetched go get -v github.com/mattn/go-sqlite3 (on the same directory where I have go.mod file)获取go get -v github.com/mattn/go-sqlite3 (在我拥有 go.mod 文件的同一目录中)

  5. go install github.com/gobuffalo/buffalo

  6. I was expecting a buffalo.exe inside %GOPATH%/bin so that I can add it to my path but didn't find one.我期待在 %GOPATH%/bin 中有一个 buffalo.exe,这样我就可以将它添加到我的路径中,但没有找到。

My question is what's wrong?我的问题是怎么了? Is the exe not installed or it's somewhere else because of go mod.是未安装 exe 还是因为 go mod 而在其他地方。 Any help will be highly appreciated.任何帮助将不胜感激。

go.mod 内容

I am using windows 10. I am not willing to install package managers as scoop or choco to install buffalo.我正在使用 Windows 10。我不愿意将包管理器安装为 scoop 或 choco 来安装 buffalo。 Thanks for your patience :)谢谢你的耐心 :)

Edited: Also tried setting set GO111MODULE=on but of no use.编辑:还尝试设置set GO111MODULE=on但没有用。

Solved:解决了:

My bad, I should have used go install github.com/gobuffalo/buffalo/buffalo instead of go install github.com/gobuffalo/buffalo我的错,我应该使用go install github.com/gobuffalo/buffalo/buffalo而不是go install github.com/gobuffalo/buffalo

github.com/gobuffalo/buffalo is a library; github.com/gobuffalo/buffalo是一个库; the corresponding binary is (aptly-named) github.com/gobuffalo/buffalo/buffalo .相应的二进制文件是(恰当命名的) github.com/gobuffalo/buffalo/buffalo

The go install command you ran should have warned you about that, but didn't because go install used to also be used to cache compiled libraries (it no longer does that in module mode).你运行的go install命令应该已经警告过你了,但没有,因为go install过去也用于缓存编译的库(它不再在模块模式下这样做)。

I've filed https://golang.org/issue/46912 to add a diagnostic.我已提交https://golang.org/issue/46912添加诊断。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM