Skip to content

unclear how to install cli on darwin-arm64 #490

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

Open
aep opened this issue Dec 25, 2020 · 7 comments
Open

unclear how to install cli on darwin-arm64 #490

aep opened this issue Dec 25, 2020 · 7 comments

Comments

@aep
Copy link

aep commented Dec 25, 2020

the instruction on https://github.com/golang-migrate/migrate/tree/master/cmd/migrate dont work

$ go version
go version go1.16beta1 darwin/arm64

$ go get -u -d github.com/golang-migrate/migrate/cmd/migrate
go: downloading github.com/golang-migrate/migrate v1.3.2
go: downloading github.com/golang-migrate/migrate v3.5.4+incompatible
go get: module github.com/golang-migrate/migrate@upgrade found (v3.5.4+incompatible), but does not contain package github.com/golang-migrate/migrate/cmd/migrate


$ git clone https://github.com/golang-migrate/migrate.git
$  go build -tags 'postgres' -ldflags="-X main.Version=$(git describe --tags)" -o $GOPATH/bin/migrate cmd/migrate/
package cmd/migrate is not in GOROOT (/usr/local/go/src/cmd/migrate)

@dhui
Copy link
Member

dhui commented Dec 27, 2020

For Go 1.16, try go install github.com/golang-migrate/migrate/cmd/migrate@latest

You're probably hitting this issue: #257 (comment)

@aep
Copy link
Author

aep commented Dec 27, 2020

aep@wurstbox: ~ go install github.com/golang-migrate/migrate/cmd/migrate@latest
go install github.com/golang-migrate/migrate/cmd/migrate@latest: module github.com/golang-migrate/migrate@latest found (v3.5.4+incompatible), but does not contain package github.com/golang-migrate/migrate/cmd/migrate

It looks like there are issues installing migratefrom within a module. e.g. a project with a go.mod file

hm nah, thats unrelated. the current directory doesnt matter

@dhui
Copy link
Member

dhui commented Dec 27, 2020

The current latest should be v4.14.1, not v3.5.4. Try go install github.com/golang-migrate/migrate/cmd/migrate@v4.14.1

@aep
Copy link
Author

aep commented Dec 27, 2020

aep@wurstbox: /tmp go install github.com/golang-migrate/migrate/cmd/migrate@v4.14.1
go install github.com/golang-migrate/migrate/cmd/migrate@v4.14.1: github.com/golang-migrate/migrate@v4.14.1: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v4

@jeromegn
Copy link

This worked for me:

go install github.com/golang-migrate/migrate/v4/cmd/migrate

@prokaktus
Copy link

prokaktus commented Feb 18, 2021

@aep because Go 1.16 runs in module-aware mode by default, you could try to explicitly disable it to run in GOPATH mode:

GO111MODULE=off go get -u -d github.com/golang-migrate/migrate/cmd/migrate

Docs link: https://tip.golang.org/doc/go1.16#modules

@shalahuddinn
Copy link

shalahuddinn commented Nov 9, 2021

This worked for me:

go install github.com/golang-migrate/migrate/v4/cmd/migrate@latest

this one is worked for me on Windows 10

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