Skip to content
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

go.mod file not found in current directory or any parent directory #223

Open
advancedwebdeveloper opened this issue Mar 26, 2021 · 4 comments

Comments

@advancedwebdeveloper
Copy link

Hello.

I was not able to build your project.
I have cloned from the master branch:

$ git log -1
commit c33b180 (HEAD -> master, origin/master, origin/HEAD)
Merge: eb3d316 eb55f68
Author: Fei Xu [email protected]
Date: Wed Jul 8 15:47:55 2020 +0800

Merge pull request #210 from dankohn/patch-1

Fix typo

$ make
go: cannot find main module, but found Gopkg.lock in /home/oceanfish81/CNI-Genie
to create a module there, run:
go mod init
rm -rf dist
echo "Building genie plugin..."
Building genie plugin...
cni-genie.go:17:2: no required module provides package github.com/cni-genie/CNI-Genie/genie: go.mod file not found in current directory or any parent directory; see 'go help modules'
cni-genie.go:18:2: no required module provides package github.com/containernetworking/cni/pkg/skel: go.mod file not found in current directory or any parent directory; see 'go help modules'
cni-genie.go:19:2: no required module provides package github.com/containernetworking/cni/pkg/types: go.mod file not found in current directory or any parent directory; see 'go help modules'
cni-genie.go:20:2: no required module provides package github.com/containernetworking/cni/pkg/version: go.mod file not found in current directory or any parent directory; see 'go help modules'
make: *** [Makefile:34: dist/genie] Error 1

$ go version
go version
go version go1.16.2 linux/arm64

$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/home/oceanfish81/.cache/go-build"
GOENV="/home/oceanfish81/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/oceanfish81/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/oceanfish81/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3441181633=/tmp/go-build -gno-record-gcc-switches"

I am working on

$ uname -a
Linux ams1-c1-large-arm-01 5.4.0-40-generic #44-Ubuntu SMP Mon Jun 22 23:59:48 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

@Vineesh314
Copy link

Try running below commands

'go mod init example.com/m' to initialize a v0 or v1 module
'go mod init example.com/m/v2' to initialize a v2 module

@amitverma80
Copy link

I am using windows 10 but getting the error go: go.mod file not found in current directory or any parent directory; see 'go help modules'

@999Cupid
Copy link

go mod tidy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants