Snap binary errors with hugo modules

The hugo snap binary (v0.58.1 extended) doesn’t seem to like hugo modules:

Error: we found a go.mod file in your project, but you need to install Go to use it. See https://golang.org/dl/.: module "github.com/holehan/hugo-components-matomo" not found; either add it as a Hugo Module or store it in "/..../..../themes".: module does not exist

Of course Go is installed. Testing the same project with the hugo binary from the github releases doesn’t throw any errors.

Anyone care to reproduce?

  • Clone project that uses hugo modules, e.g. https://github.com/bep/docuapi.git
  • Build project with snap version of hugo /var/lib/snapd/snap/bin/hugo (mine is on Manjaro Linux)

Hm, it seems the snap package isn’t very popular among hugo users :thinking:. I’ll stop using the snap package for now and rely on my own update script (inspired by Script to install latest hugo release on macos and ubuntu).

1 Like