Skip to content

cmd/go: install gopls fails: module found, but does not contain package #74109

@ancientjpeg

Description

@ancientjpeg

Go version

go version go1.24.4 darwin/arm64

Output of go env in your module/workspace:

AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/officialnsa/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/officialnsa/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/kl/kqwhw69x11z0bj42fhljq57c0000gn/T/go-build1909660288=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/Users/officialnsa/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/officialnsa/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/officialnsa/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.4'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Attempted to install gopls using the recommended installation method:

$ go install golang.org/x/tools/gopls@latest

I should note, this was after attempting to install using mason.nvim. I also uninstalled go via brew and installed using the package installer, but still encountered the issue.

What did you see happen?

go: golang.org/x/tools/gopls@latest: module golang.org/x/tools/gopls@latest found (v0.18.1), but does not contain package golang.org/x/tools/gopls

What did you expect to see?

Expected to see a successful installation, but encountered this error after every attempt.

I noticed this issue was reported in #59281, but never resolved. I've also seen multiple reports by mason.nvim users that they've encountered this issue—some people had this fixed by unsetting GOOS and GOARCH, but that didn't resolve the issue for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goQuestionIssues that are questions about using Go.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      close