On 18.05.21 13:18, Zhao Shuxin wrote:
> Hi folks,
> 
> My project has a dependency on github.com/prometheus/client_golang@master. 
> I got following error when installing my project
> 
> $ dep init; dep ensure -v -add "my project"
> [INFO] failed to handle solve conflicts: No versions of 
> github.com/cespare/xxhash met constraints:
> v2.1.1: Could not introduce github.com/cespare/[email protected], as its 
> subpackage github.com/cespare/xxhash/v2 is missing. (Package is required by 
> github.com/prometheus/client_golang@master.)
> v2.1.0: Could not introduce github.com/cespare/[email protected], as its 
> subpackage github.com/cespare/xxhash/v2 is missing. (Package is required by 
> github.com/prometheus/client_golang@master.)
> v2.0.0: Could not introduce github.com/cespare/[email protected], as its 
> subpackage github.com/cespare/xxhash/v2 is missing. (Package is required by 
> github.com/prometheus/client_golang@master.)
> v1.1.0: Could not introduce github.com/cespare/[email protected], as its 
> subpackage github.com/cespare/xxhash/v2 is missing. (Package is required by 
> github.com/prometheus/client_golang@master.)
> v1.0.0: Could not introduce github.com/cespare/[email protected], as its 
> subpackage github.com/cespare/xxhash/v2 is missing. (Package is required by 
> github.com/prometheus/client_golang@master.)
> master: Could not introduce github.com/cespare/xxhash@master, as its 
> subpackage github.com/cespare/xxhash/v2 is missing. (Package is required by 
> github.com/prometheus/client_golang@master.)
> 
> github.com/cespare/xxhash is required by 
> github.com/prometheus/client_golang@master. 
> 
> Did you know what could go wrong? Thanks for your help!

You are using dep, which is deprecated. From
https://github.com/golang/dep: "As of 2020, Dep is deprecated and
archived in favor of Go modules, which have had official support since
Go 1.11. For more details, see https://golang.org/ref/mod.";

The above error happens because of the way Go modules deals with major
versions beyond 1.x. (And github.com/cespare/xxhash/v2 is a Go module
with v2.x.) That's not understood by dep.

You have to either use Go modules or do something manual to get your
dependencies into place.
-- 
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/20210525175057.GC3747%40jahnn.

Reply via email to