1
votes

I have a mix.exs file that has some dependencies:

def deps do
    [{:nadia, "~> 0.4"}]
end

Let's say I want to change Nadia to version 0.3. I'm having a hard time doing that.

After making the change to mix.exs, I can't get the version 0.3 for Nadia. Neither mix deps.update nor mix deps.unlock && mix deps.update help me.

I'm sure there's a way to do this; I just couldn't find it.

Thanks in advance!

1
You want to switch to 0.3 or 3.0?Dogbert
@Dogbert to 0.3. Fixed it.thepanuto

1 Answers

8
votes

The reason the requirement ~> 0.3 gives you 0.4.0 is because ~> 0.3 is equivalent to >= 0.3.0 and < 1.0.0 (ref). If you want >= 0.3.0 and < 0.4.0, you need to use the requirement ~> 0.3.0:

def deps do
  [{:nadia, "~> 0.3.0"}]
end

A simple mix deps.get after changing your mix.exs will give you the latest 0.3.x version of nadia. There's no need to run mix deps.unlock or mix deps.update.