hugo-toha / hugo-toha.github.io

An example hugo static site with Toha theme.
https://hugo-toha.github.io
MIT License
110 stars 564 forks source link

Hugo Local Build Failing #320

Open raj-patra opened 2 months ago

raj-patra commented 2 months ago

Resynced my fork after many months and rebased and squashed my changes to make the commit tree neater. Now I cannot build after npm install

hugo mod tidy and hugo server -w gives the following error:

go: github.com/hugo-toha/toha/v4@v4.5.1-0.20240601184722-8599c634e39f: invalid version: git ls-remote -q origin in C:\Users\Raj P\AppData\Local\hugo_cache\modules\filecache\modules\pkg\mod\cache\vcs\3cb566cfd171305ed51f5847660e8d04cf501c2ca92f1cf32f2336acf1eb47a2: exit status 128:
        fatal: 'origin' does not appear to be a git repository
        fatal: Could not read from remote repository.

        Please make sure you have the correct access rights
        and the repository exists.
hugo: collected modules in 931 ms
Error: failed to load modules: failed to download modules: failed to execute 'go [mod download -modcacherw]': failed to execute binary "go" with args [mod download -modcacherw]: go: github.com/hugo-toha/toha/v4@v4.5.1-0.20240601184722-8599c634e39f: invalid version: git ls-remote -q origin in C:\Users\Raj P\AppData\Local\hugo_cache\modules\filecache\modules\pkg\mod\cache\vcs\3cb566cfd171305ed51f5847660e8d04cf501c2ca92f1cf32f2336acf1eb47a2: exit status 128:
        fatal: 'origin' does not appear to be a git repository
        fatal: Could not read from remote repository.

        Please make sure you have the correct access rights
        and the repository exists.
 *errors.errorString

Here's the content of my go.mod file

module github.com/raj-patra/raj-patra.github.io

go 1.21

require github.com/hugo-toha/toha/v4 v4.5.1-0.20240601184722-8599c634e39f // indirect

// replace(
//     github.com/hugo-toha/toha/v4 => ../toha
// )

Any help is appreciated.

BernatBC commented 1 week ago

Hi @raj-patra, sorry for the late response. You can try the following commands:

git submodule update --remote
hugo mod get -u ./..
hugo mod tidy
hugo npm pack
npm install