Hugo module failing

I have a project that uses modules for the first time. It was working fine until today I started getting this message when running hugo server:

go: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /var/folders/xb/7x2qm97153q23rhtss8tmvwm0000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/cfef32bb6c1ad28949037324bf093438f03a68544f34854a1bff45d9a9f55ca7: exit status 128:
	fatal: not a git repository (or any of the parent directories): .git

Tried hugo mod get to update the module, but it’s not working. What am I missing?

Please try clearing your mod cache:

hugo mod clean --all

If that doesn’t work, please delete the Hugo cache directory. Obtain the path to the Hugo cache directory with:

hugo config | grep cachedir

Please let us know what worked.

It may be advantageous to set your HUGO_CACHEDIR environment variable to something other than the system temporary directory, but make sure that it is outside of your project path. Related comments:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.