bee icon indicating copy to clipboard operation
bee copied to clipboard

unable to install at go 1.18

Open maulanaoldies opened this issue 2 years ago • 6 comments

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 avatar Mar 23 '22 08:03 maulanaoldies

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

flycash avatar Apr 01 '22 07:04 flycash

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'.

ybitso avatar Apr 09 '22 17:04 ybitso

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

tourdt avatar Apr 14 '22 11:04 tourdt

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 avatar May 02 '22 19:05 Macavity

I realised there are some unmerged changes in develop: https://github.com/beego/bee/commit/e3d0b640df8483897a3bf9bf6a9b3cb29335144f

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

Macavity avatar May 03 '22 09:05 Macavity

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.

aikego avatar May 10 '22 10:05 aikego