What this thread does
no required module provides package
The import named after this diagnostic prefix has no provider in the current module build.
Do first: run go env GOMOD GOWORK in the failing directory; compare the reported module/workspace files with the project you intended to build. Go 1.27.0 command reference
Evidence: the command reference defines module selection; a March 12, 2021 report shows the suggested go get command failing for a misspelled internal import. mvdan lists “Writing an import manually and making a typo” as a trigger. mvdan's issue #44961
Not for: Cargo workspace.package.edition errors; see cargo-workspace-edition-publish-plan-gitlab-ci-os-error-2
Diagnostic: no required module provides package
As of November 2026, this recipe targets Go 1.27.0, whose versioned command documentation is dated August 19, 2026. The error's trailing package path varies by project. Command documentation, Go 1.27 release notes
Choose the branch
1. GOMOD names the wrong project or no module → select the intended root. On Go 1.27.0, change to the directory with the intended go.mod, then repeat go env GOMOD GOWORK and go build ./.... For a genuinely new project with no module file, initialize its intended module path with go mod init example.com/project first; replace that example with your module's path. Confirmation is the intended module file and a build without the original import error. Official module creation tutorial
2. The import starts with your own module path → inspect its directory suffix. On Go 1.27.0, compare the import with the module line and the real directory containing that package. Correct a spelling, moved directory, or missing major-version suffix before fetching anything. Run go list ./... and go build ./...; the package should resolve to the intended source directory. The official rule is module path plus package subdirectory. Official package layout guide, independent typo report
3. The import belongs to an external module → add a deliberate requirement. On Go 1.27.0, use the package provider's documentation to identify its module path and a real release tag. Run go get MODULE@VERSION, substituting those values, then go mod tidy. Inspect the resulting go.mod and go.sum; go list IMPORT_PATH followed by go build ./... should resolve and compile the original import. MODULE, VERSION, and IMPORT_PATH are placeholders, not literal package names. Official dependency management guide
4. The provider is a sibling checkout with its own go.mod → include that module locally. On Go 1.27.0, from the consumer root run go work init . ../library if no workspace exists, or go work use . ../library in the existing workspace; substitute the sibling module directory. Its declared module path must match the import. Confirm go env GOWORK selects that file and go build ./... succeeds from the consumer. Versioned workspace commands
Limits
A local workspace can make a checkout build without making its module independently consumable. Decide separately how the sibling is released and required. Access-denied, proxy, checksum, and excluded-source diagnostics need their own evidence; repeatedly fetching the same import does not repair a directory typo. Workspace semantics, public report
Started from a post by @The Go Authors, packaged by the editor. Original post