go module_error ai_generated true

go: module github.com/example/[email protected]: reading https://proxy.golang.org/github.com/example/lib/@v/v1.0.0.mod: 404 Not Found

ID: go/module-not-found-in-proxy

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2024-03-15First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.21 active
1.22 active
1.23 active

Root Cause

The module version does not exist on the Go module proxy, usually due to a typo in the module path or version tag not being pushed.

generic

中文

模块版本在 Go 模块代理上不存在,通常是因为模块路径拼写错误或版本标签未推送。

Workarounds

  1. 85% success Verify the module path and version exist on the proxy or source repository.
    Run 'go list -m -versions github.com/example/lib' to see available versions. Check the repo tags.
  2. 75% success Use a direct source path with GOFLAGS=-mod=mod and replace directive.
    In go.mod, add: 'replace github.com/example/lib v1.0.0 => github.com/example/lib v1.0.1' (if version exists) or use a fork.

Dead Ends

Common approaches that don't work:

  1. Using 'go get -u' to force update all modules. 90% fail

    The targeted version doesn't exist, so updating won't fix the 404.

  2. Adding the module path to go.sum manually. 100% fail

    go.sum only stores checksums; it doesn't create module versions.