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

unable to install at go 1.18 #816

Open
maulanaoldies opened this issue Mar 23, 2022 · 6 comments
Open

unable to install at go 1.18 #816

maulanaoldies opened this issue Mar 23, 2022 · 6 comments

Comments

@maulanaoldies
Copy link

maulanaoldies commented Mar 23, 2022

mac 12.2.1
go 1.18 darwin/amd64
i tried to follow the docs, but on go 1.18 i cant use go get outside the module
and this happened.

maulanaoldies@adsl-172-10-8-202 src % go get github.com/beego/bee/v2
go: go.mod file not found in current directory or any parent directory.
	'go get' is no longer supported outside a module.
	To build and install a command, use 'go install' with a version,
	like 'go install example.com/cmd@latest'
	For more information, see https://golang.org/doc/go-get-install-deprecation
	or run 'go help get' or 'go help install'.
maulanaoldies@adsl-172-10-8-202 ~ % go install github.com/beego/bee/v2@latest
go: downloading github.com/beego/beego v1.12.3
.....
go: downloading golang.org/x/text v0.3.3
# golang.org/x/sys/unix
development/go/pkg/mod/golang.org/x/[email protected]/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.1_13.go:40:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:121:3: too many errors
maulanaoldies@adsl-172-10-8-202 ~ % 
@maulanaoldies maulanaoldies changed the title unabel to install at go 1.18 unable to install at go 1.18 Mar 23, 2022
@flycash
Copy link
Collaborator

flycash commented Apr 1, 2022

it seems that something wrong with your environment. Can you try the command in other computer?

@ybitso
Copy link

ybitso commented Apr 9, 2022

I get the same thing from 2 different machines (go 1.17.8 for both)

go get github.com/beego/bee/v2


go: downloading go.starlark.net v0.0.0-20190702223751-32f345186213
go: downloading golang.org/x/text v0.3.3
go get: installing executables with 'go get' in module mode is deprecated.
	Use 'go install pkg@version' instead.
	For more information, see https://golang.org/doc/go-get-install-deprecation
	or run 'go help get' or 'go help install'.

@tourdt
Copy link

tourdt commented Apr 14, 2022

go install github.com/beego/bee/v2@latest

golang.org/x/sys/unix

../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.1_13.go:27:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.1_13.go:40:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:28:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:43:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:59:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:75:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:90:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:105:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:121:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:121:3: too many errors

@Macavity
Copy link

Macavity commented May 2, 2022

Since Go 1.16 go get can't be used anymore to install executables globally.
They explained that in a blog post

Knowing that didn't get me much farther though.
Trying go install github.com/beego/bee/[email protected] or go install github.com/beego/bee/v2@latest results in the same errors as @tourdt mentioned.

Other tries failed as well:

go install github.com/beego/bee/[email protected]
go: github.com/beego/bee/[email protected]: github.com/beego/[email protected]: invalid version: module contains a go.mod file, so module path must match major version ("github.com/beego/bee/v2")
go install github.com/beego/bee/[email protected]
go: github.com/beego/bee/[email protected]: github.com/beego/[email protected]: invalid version: module contains a go.mod file, so module path must match major version ("github.com/beego/bee/v2")

Strangely the version of beego in go.mod actually seems to be correct for 2.0.1 and 2.0.0 - but for 2.0.2 the version is wrongfully referring

require (
	github.com/beego/beego/v2 v2.0.1

I tried using Go 1.17.9 and 1.18.1 - no luck 🤷‍♂️

@Macavity
Copy link

Macavity commented May 3, 2022

I realised there are some unmerged changes in develop: e3d0b64

These fix the issue for me.

For anyone who can't wait, you can install the develop version of bee like this:
go install github.com/beego/bee/v2@develop

@aikego
Copy link

aikego commented May 10, 2022

I realised there are some unmerged changes in develop: e3d0b64

These fix the issue for me.

For anyone who can't wait, you can install the develop version of bee like this: go install github.com/beego/bee/v2@develop

--- I do it by this way, The problem is solved , I don't know if there are any other effects.

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

6 participants