Dep: gps/constraint.go:149:4: undefined: semver.Constraint

Created on 11 Dec 2019  路  5Comments  路  Source: golang/dep

Hi,

Hope you are all well !

While trying to "go get -u github.com/golang/dep/cmd/dep" in an alpine based docker container, I have the following error (last line):

+ go get -u github.com/golang/dep/cmd/dep
go: finding github.com/golang/dep v0.5.4
go: downloading github.com/golang/dep v0.5.4
go: extracting github.com/golang/dep v0.5.4
go: downloading golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: extracting golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: downloading github.com/pkg/errors v0.8.0
go: downloading github.com/pelletier/go-toml v1.2.0
go: extracting github.com/pkg/errors v0.8.0
go: extracting github.com/pelletier/go-toml v1.2.0
go: finding github.com/Masterminds/semver v1.5.0
go: downloading github.com/Masterminds/semver v1.5.0
go: downloading github.com/golang/protobuf v1.2.0
go: downloading golang.org/x/sys v0.0.0-20190422165155-953cdadca894
go: finding github.com/jmank88/nuts v0.4.0
go: extracting github.com/Masterminds/semver v1.5.0
go: downloading github.com/jmank88/nuts v0.4.0
go: extracting github.com/golang/protobuf v1.2.0
go: finding github.com/Masterminds/vcs v1.13.1
go: finding github.com/armon/go-radix v1.0.0
go: finding github.com/sdboyer/constext latest
go: finding github.com/nightlyone/lockfile latest
go: downloading github.com/armon/go-radix v1.0.0
go: downloading github.com/Masterminds/vcs v1.13.1
go: downloading github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353
go: downloading github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443
go: extracting github.com/jmank88/nuts v0.4.0
go: extracting github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443
go: extracting github.com/Masterminds/vcs v1.13.1
go: extracting github.com/armon/go-radix v1.0.0
go: extracting github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353
go: downloading github.com/boltdb/bolt v1.3.1
go: extracting golang.org/x/sys v0.0.0-20190422165155-953cdadca894
go: downloading gopkg.in/yaml.v2 v2.2.1
go: extracting github.com/boltdb/bolt v1.3.1
go: extracting gopkg.in/yaml.v2 v2.2.1
go: downloading golang.org/x/sys v0.0.0-20191026070338-33540a1f6037
go: extracting golang.org/x/sys v0.0.0-20191026070338-33540a1f6037
go: finding github.com/boltdb/bolt v1.3.1
go: finding github.com/pkg/errors v0.8.1
go: finding gopkg.in/yaml.v2 v2.2.7
go: finding github.com/golang/protobuf v1.3.2
go: finding golang.org/x/sys latest
go: finding golang.org/x/sync latest
go: finding github.com/pelletier/go-toml v1.6.0
go: downloading golang.org/x/sys v0.0.0-20191210023423-ac6580df4449
go: downloading github.com/pkg/errors v0.8.1
go: downloading github.com/golang/protobuf v1.3.2
go: downloading golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
go: downloading github.com/pelletier/go-toml v1.6.0
go: downloading gopkg.in/yaml.v2 v2.2.7
go: extracting github.com/pkg/errors v0.8.1
go: extracting golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
go: extracting github.com/pelletier/go-toml v1.6.0
go: extracting gopkg.in/yaml.v2 v2.2.7
go: extracting github.com/golang/protobuf v1.3.2
go: extracting golang.org/x/sys v0.0.0-20191210023423-ac6580df4449
# github.com/golang/dep/gps
/go/pkg/mod/github.com/golang/[email protected]/gps/constraint.go:149:4: undefined: semver.Constraint

Is there any issue with the package ?

Cheers,
X.

All 5 comments

Here meet the same problem.

$ go get -u github.com/golang/dep/cmd/dep
go: finding golang.org/x/sync latest
go: finding github.com/sdboyer/constext latest
go: finding github.com/nightlyone/lockfile latest
go: finding golang.org/x/sys latest
# github.com/golang/dep/gps
../../pkg/mod/github.com/golang/[email protected]/gps/constraint.go:149:4: undefined: semver.Constraint

Here meet the same problem.

$ go get -u github.com/golang/dep/cmd/dep
go: finding golang.org/x/sync latest
go: finding github.com/sdboyer/constext latest
go: finding github.com/nightlyone/lockfile latest
go: finding golang.org/x/sys latest
# github.com/golang/dep/gps
../../pkg/mod/github.com/golang/[email protected]/gps/constraint.go:149:4: undefined: semver.Constraint

solve this problem with using proxychains

proxychains curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

I too was having the problem, so I did:
$ go env -w GO111MODULE=off
to turn off Go Modules, before installing dep:
$ go get -u github.com/golang/dep

Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abeMedia picture abeMedia  路  3Comments

mohanraj-r picture mohanraj-r  路  3Comments

eleijonmarck picture eleijonmarck  路  3Comments

deejross picture deejross  路  3Comments

rogpeppe picture rogpeppe  路  4Comments