beego / bee

Bee is a tool for helping develop with beego app framework.
Apache License 2.0
1.44k stars 920 forks source link

unable to install at go 1.18 #816

Open maulanaoldies opened 2 years ago

maulanaoldies commented 2 years ago

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/sys@v0.0.0-20200930185726-fdedc70b468f/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/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/sys@v0.0.0-20200930185726-fdedc70b468f/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/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable
development/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_amd64.go:121:3: too many errors
maulanaoldies@adsl-172-10-8-202 ~ % 
flycash commented 2 years ago

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

ybitso commented 2 years ago

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 commented 2 years ago

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

golang.org/x/sys/unix

../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.1_13.go:27:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.1_13.go:40:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.go:28:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.go:43:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.go:59:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.go:75:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.go:90:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.go:105:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.go:121:3: //go:linkname must refer to declared function or variable ../../go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_arm64.go:121:3: too many errors

Macavity commented 2 years ago

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/v2@v2.0.2 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/v2@v2.0.1
go: github.com/beego/bee/v2@v2.0.1: github.com/beego/bee@v2.0.1: 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/v2@v2.0.0
go: github.com/beego/bee/v2@v2.0.0: github.com/beego/bee@v2.0.0: 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 commented 2 years ago

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

aikego commented 2 years ago

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.