Skip to content
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

... has invalid version ~> Version_1 or ~> Version_2 #6

Open
ulfa opened this issue Apr 20, 2019 · 11 comments
Open

... has invalid version ~> Version_1 or ~> Version_2 #6

ulfa opened this issue Apr 20, 2019 · 11 comments

Comments

@ulfa
Copy link

ulfa commented Apr 20, 2019

Hi,

I am trying to use rebar3_mix, but when ich declare a dependency like
{timex, "~> 3.5"} rebar3 tries to download the dependencies from timex.

But the dependency of the timex package tzdata is declared in the mix.exs as {:tzdata, "~> 0.1.8 or ~> 0.5"} and I think rebar3 can't manage this.

@tsloughter
Copy link
Collaborator

Afraid that is the case, yes. For now you could try adding tzdata to your rebar.config list of dependencies too, then it might ignore the version requirement it can't handle.

@ulfa
Copy link
Author

ulfa commented May 7, 2019

Hi, this doesn't work, because rebar3 always checks the version of the dependency.

@tsloughter
Copy link
Collaborator

Damn, that is right, it will parse the version so it can print a warning that it is in conflict.

Maybe a quick fix is to not care if it can't parse the version if the dep isn't actually going to be used. Like in this case if you have tzdata at the top level with a version constraint rebar3 understands it can safely ignore the one it can't parse later on.

@auror
Copy link

auror commented Feb 19, 2021

+1

Added tzdata to the deps in rebar.config, but got this in crashdump

Error: badarg
[{erlang,binary_to_atom,[undefined,utf8],[]},
 {rebar_app_info,apply_overrides,2,
                 [{file,"/Users/emqer/code/rebar3/src/rebar_app_info.erl"},
                  {line,596}]},
 {rebar_prv_install_deps,handle_dep,6,
                         [{file,"/Users/emqer/code/rebar3/src/rebar_prv_install_deps.erl"},
                          {line,306}]},
 {rebar_prv_install_deps,update_unseen_dep,9,
                         [{file,"/Users/emqer/code/rebar3/src/rebar_prv_install_deps.erl"},
                          {line,298}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1267}]},
 {rebar_prv_install_deps,handle_profile_level,7,
                         [{file,"/Users/emqer/code/rebar3/src/rebar_prv_install_deps.erl"},
                          {line,183}]},
 {rebar_prv_install_deps,do_,1,
                         [{file,"/Users/emqer/code/rebar3/src/rebar_prv_install_deps.erl"},
                          {line,82}]},
 {rebar_core,do,2,
             [{file,"/Users/emqer/code/rebar3/src/rebar_core.erl"},
              {line,154}]}]

@tsloughter
Copy link
Collaborator

We'll have a new release of rebar3 soon that can handle these versions.

@tsloughter
Copy link
Collaborator

Sorry, I forgot that the PR to fix this was actually reverted because of issues it caused erlang/rebar3#2486

@tclugao
Copy link

tclugao commented Apr 18, 2023

I also meet the issue "Dep decimal has invalid version ~> 1.0 or ~> 2.0" when I am using rebar3 to download the elixir deps {protobuf, "0.10.0"}

related info:
rebar 3.13.2 on Erlang/OTP 22 Erts 10.7.2
{rebar_mix, "0.5,0"}

@ferd
Copy link
Contributor

ferd commented Apr 18, 2023

You might at least want to try a newer Rebar3, we'Re up to 3.20.

@tclugao
Copy link

tclugao commented Apr 20, 2023

@ferd I update to rebar3 : rebar 3.17.0 on Erlang/OTP 22 Erts 10.7.2, still have the problem "Dep decimal has invalid version ~> 1.0 or ~> 2.0"

@tsloughter
Copy link
Collaborator

Can you try the latest, 3.20.0? How are you installing rebar3? You can download an escript from https://www.rebar3.org/

@tclugao
Copy link

tclugao commented Apr 21, 2023

@tsloughter installed from source code, also have issue
image

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