Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: failed to load modules: failed to download modules: binary with name "go": not found. #1691

Closed
hurrellit opened this issue Oct 15, 2023 · 1 comment

Comments

@hurrellit
Copy link

hurrellit commented Oct 15, 2023

I am new to Hugo and Docsy and I am having the following error when attempting to build my website locally using the hugo or hugo server commands:

Error: failed to load modules: failed to download modules: binary with name "go": not found

My repo is stored on Gitlab.com and my website fully functions when built with Gitlab and published to Gitlab Pages, and the first time I tried to build it locally using hugo server it worked fine, but now both hugo and hugo server commands result in this error. I am using Hugo Modules (basically I have cloned the Docsy example site and tweaked it for my use).

My local server is Ubuntu 22.04 and I have the following:

  • Hugo extended version installed via dpkg v 0.119.0
  • Git 2.34.1 via apt
  • Go 1.21.3 downloaded directly and installed to /usr/local/go, with /usr/local/go/bin on the PATH
  • Node.js 18.18.2 via nvm

My hugo.toml file contains these lines:

[module]
  # uncomment line below for temporary local development of module
  # replacements = "github.com/google/docsy -> ../../docsy"
  [module.hugoVersion]
    extended = true
    min = "0.110.0"
  [[module.imports]]
    path = "github.com/google/docsy"
    disable = false
  [[module.imports]]
    path = "github.com/google/docsy/dependencies"
    disable = false

And I have go.mod and go.sum files.

Incidentally I have the same issue when trying to deploy via AWS Amplify: aws-amplify/amplify-hosting#884 (comment).

Does anyone have any suggestions about this error and how to fix it? I appreciate I might be doing something wrong herr and expecting it work....!

@hurrellit
Copy link
Author

OK, so I apologise, but it seems that I had only set the PATH environment variable for go temporarily. Adding it to /etc/profile rebooting and trying again now works.

Rather embarrassed, but at least that also gives me a clue for Amplify. Sorry for the "noise"...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant