go
module_error
ai_generated
true
go: github.com/foo/[email protected]: reading github.com/foo/bar/go.mod at revision v1.2.3: module not found
ID: go/go-mod-tidy-fails-with-module-not-found
92%Fix Rate
83%Confidence
1Evidence
2023-05-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| go1.18 | active | — | — | — |
| go1.19 | active | — | — | — |
| go1.20 | active | — | — | — |
Root Cause
The specified module version does not exist in the module proxy or upstream repository, often due to a typo in version tag or a deleted release.
generic中文
指定的模块版本在模块代理或上游仓库中不存在,通常由于版本标签拼写错误或已删除的发布。
Official Documentation
https://go.dev/ref/modWorkarounds
-
95% success Check available versions: go list -m -versions github.com/foo/bar; then use a valid version.
Check available versions: go list -m -versions github.com/foo/bar; then use a valid version.
-
85% success Use the latest version by removing @v1.2.3: go get github.com/foo/bar@latest
Use the latest version by removing @v1.2.3: go get github.com/foo/bar@latest
-
70% success Set GONOSUMCHECK and GONOSUMDB env vars to bypass proxy restrictions: export GONOSUMCHECK=*; export GONOSUMDB=*; then go mod tidy
Set GONOSUMCHECK and GONOSUMDB env vars to bypass proxy restrictions: export GONOSUMCHECK=*; export GONOSUMDB=*; then go mod tidy
中文步骤
Check available versions: go list -m -versions github.com/foo/bar; then use a valid version.
Use the latest version by removing @v1.2.3: go get github.com/foo/bar@latest
Set GONOSUMCHECK and GONOSUMDB env vars to bypass proxy restrictions: export GONOSUMCHECK=*; export GONOSUMDB=*; then go mod tidy
Dead Ends
Common approaches that don't work:
-
90% fail
-e flag only suppresses error output, module still missing.
-
70% fail
go.sum regeneration requires valid module version; missing version persists.