duanjiaolia97750 2019-07-17 11:21
浏览 109

在水牛城中生成新项目失败,并显示GO111MODULE问题

I am trying out buffalo for the first time.

I manually installed the pre-requisites rather than using scoop because I didn't know where scoop would put things: https://www.stuartellis.name/articles/windows-golang-setup/#installing-buffalo

Installed buffalo using this from Powershell and it seemed to work OK:

go get -u -v github.com/gobuffalo/buffalo/buffalo

However when I went to generate a new project using this example: https://gobuffalo.io/en/docs/getting-started/new-project/

buffalo new coke

I receive the following.

DEBU[2019-07-17T20:55:51+10:00] Exec: go mod init coke
go: modules disabled inside GOPATH/src by GO111MODULE=auto; see 'go help modules'

If anyone has any idea of what the problem is or how I can avoid it please let me know.

I don't know how to set GO111MODULE within Windows and I've googled this issue for the past 2 hours without success including searches on https://gobuffalo.io

I've tried reinstalling buffalo but this didn't help.

My GOPATH is E:\dev\go

Here is what I issued in order to create a new buffalo project (and I issued it from the correct folder within GOPATH E:\dev\go\src\github.com\):

buffalo new coke

Here is the result from issuing 'go env'.

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\canto\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=e:\dev\go
set GOPROXY=
set GORACE=
set GOROOT=e:\Go
set GOTMPDIR=
set GOTOOLDIR=e:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\canto\AppData\Local\Temp\go-build677176826=/tmp/go-build -gno-record-gcc-switches

I have successfully created a sample 'coke' buffalo project at work however it fails on my home workstation.

  • 写回答

2条回答 默认 最新

  • dqvrlgi3247 2019-07-20 03:44
    关注

    Started again from scratch, manually uninstalled everything.

    Following this: https://www.stuartellis.name/articles/windows-golang-setup/

    I just used scoop to create a default install of all the apps; I knew I wouldn't like the result because it put them all on my C:\users\ which is only for my OS

    Then I ran buffalo new coke which failed with an error message along the lines of 'you need to be inside GOPATH'

    Then I ran buffalo info which gave me all sorts of useful stuff, one of which told me that my PATH needed to match where I was running it from (which I thought was quite clever of it), then light dawned, my path was e:\dev\go and I was running it from E:\dev\go\src. Yes, a capitalization issue. Changed my path to 'E:\dev\go', reran buffalo info and only got warnings about things I wasn't interested in, ran buffalo new coke and it worked.

    Now I'm uninstalling scoop and all my scooped apps, changing my custom path using SCOOP and SCOOP_GLOBAL and then re-installing scoop and all the apps again via scoop.

    So, capitalization.

    评论

报告相同问题?

悬赏问题

  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 C#调用python代码(python带有库)
  • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面