hugo-toha / toha

A Hugo theme for personal portfolio
https://hugo-toha.github.io
MIT License
1.04k stars 597 forks source link

Why does it prompt an error when using `hugo server` in Git bash? #855

Closed Chow-Ray closed 10 months ago

Chow-Ray commented 10 months ago

Question

Why does it prompt an error when using hugo server in Git bash? Error: command error: failed to load modules: failed to download modules: binary with name "go" not found

but It can be used normally in cmd。

Golang has been successfully installed, you can use the go env and go version commands, and there will be successful feedback.

Please help me, I have searched Google and ChatGPT, but there is no answer.

hossainemruz commented 10 months ago

You need to install Go. Check the requirements section. https://github.com/hugo-toha/toha?tab=readme-ov-file#requirements

Chow-Ray commented 10 months ago

You need to install Go. Check the requirements section. https://github.com/hugo-toha/toha?tab=readme-ov-file#requirements

I have installed go successfully. And using cmd, run hugo server successfully preview the website. If go is not successfully installed, it cannot be run, right?

$ go version
go version go1.21.5 windows/amd64
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=E:\Program Files\Go\bin
set GOCACHE=C:\Users\Rcc\AppData\Local\go-build
set GOENV=C:\Users\Rcc\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=E:\Program Files\Go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=E:\Program Files\Go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=E:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=E:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.21.5
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=G:\Hugo-Blog\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\R\AppData\Local\Temp\go-build1354967136=/tmp/go-build -gno-record-gcc-switches
hossainemruz commented 10 months ago

Hugo will be able to preview website without Go if it does not depend on any module. For website with module dependency, you have to install Go.

hossainemruz commented 10 months ago

I have installed go successfully. And using cmd, run hugo server successfully preview the website. If go is not successfully installed, it cannot be run, right?

Does it means your problem has been resolved? If so, please close this issue.

Chow-Ray commented 10 months ago

Hugo will be able to preview website without Go if it does not depend on any module. For website with module dependency, you have to install Go.

I'm really helpless. I have successfully installed go and have feedback. I don't know why you always reply the same thing. Are you a robot?

Chow-Ray commented 10 months ago

Does it means your problem has been resolved? If so, please close this issue.

not solved

hossainemruz commented 10 months ago

What is your Hugo version?

Chow-Ray commented 10 months ago

What is your Hugo version?

$ hugo version hugo v0.121.1-00b46fed8e47f7bb0a85d7cfc2d9f1356379b740+extended windows/amd64 BuildDate=2023-12-08T08:47:45Z VendorInfo=gohugoio

hossainemruz commented 10 months ago

I am really confused. 😕 Everything looks fine. I don't see any reason why you should see that error. Can you please point me to your repository? I have to try running it in windows (need to check if I have windows in any device).

Chow-Ray commented 10 months ago

I am really confused. 😕 Everything looks fine. I don't see any reason why you should see that error. Can you please point me to your repository? I have to try running it in windows (need to check if I have windows in any device).

I also can't understand why such a problem occurs. There is no problem using CMD and vs code, only Git bash has problems. The repository is huge, I’ll think about how to send it to you.

Chow-Ray commented 10 months ago

I am really confused. 😕 Everything looks fine. I don't see any reason why you should see that error. Can you please point me to your repository? I have to try running it in windows (need to check if I have windows in any device).

Can you tell me the version numbers of your Git, go, and hugo?

hossainemruz commented 10 months ago

I use Linux🐧. So, not using Git Bash. If it is working with CMD and VS Code, then the issue is not related to the theme.