-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: "cannot find module for path" #27238
Comments
The similar error occurred on my machine cannot find module for path golang.org/x/crypto/ssh but I can find the ssh module in my $GOPATH |
Can you paste the output of |
as follows:
|
same problem with the package golang.org/x/sys/unix. |
What version of the This looks like the same symptoms as a bug that was fixed in 1.11beta2 or 1.11rc1. |
+1 Getting similar issue in go v 1.11. Any updates or workaround? Cannot find module for path golang.org/x/text/secure/bidirule |
Ok, that's interesting. There may be a bad interaction here with the fix for #26885: it looks like we're not crawling up to the module root for these subpackages for some reason. |
having a similar issue
|
I was having this issue. I solved it by deleting all my $GOPATH/pkg/mod directory and downloading everything again. |
can confirm that clearing the |
As a general rule, don't force-anything in the module cache. ( |
Had you been using modules before the Go 1.11 release (either in a 1.11 prerelease or using (I'd like to understand whether this sort of module corruption is happening in the wild, or just a pre-release bug that got fixed.) |
No, I started using go1.11 recently, installed it using
This also happened to me, I had to |
Folks who have been affected by this: is it possible that you were running multiple 'go' commands concurrently (#26794)? (I'm trying to pin down the cause of the module corruption.) |
For me the error occurs when I run go build from within the built-in terminal in vscode but not from within Terminal. Unless vscode is running another instance of the go command, I am only invoking it once. I am using local package dependency. All packages (including this package main) are in my GOPATH and I have GO111MODULE=on. go version go1.11.1 darwin/amd64
in Terminal:
|
@DrGo, I don't see a package |
Given that @DrGo's report has a plausible explanation in #27859 and there haven't been any other replies to my question above (#27238 (comment)), I'm going to proceed on the theory that the remaining cases are explained by #26794 (or, at the very least, will be fixed by the fix for it). Please do share details if you're able to reproduce one of these failures that does not match either #26794 or #27859. |
Windows 10, 64bit, Go 1.11.1 (to start with a clean state I deleted the
no mod folder is created for the dependencies in GOPATH after the command. contents of cache folder for iota.go package: go.mod file content after command:
go env:
|
Closing this as a duplicate of #26794: the cases that are solved by clearing the module cache ( |
What did you do?
First , I cleaned $GOPATH/pkg/mod ,
then I wrote a program under ~/testgo/main.go
and then I typed cmmand:
go mod init testgo
on then same directory. And the go.mod file is:What did you expect to see?
build success without any error.
What did you see instead?
it build failed with output as below:
and now the go.mod file is:
until I add all of cannot find modules to go.mod by myself .
More infomation
I'm in China but I had set the https_proxy and http_proxy, so I can visit google.com and golang.org.
The error module is not always the
golang.org/x/crypto
, it say sometimesgolang/x/sys
orgolang/x/net
System details
The text was updated successfully, but these errors were encountered: