Reputation: 3221
I was trying to install Addict, so I added to mix.ex its latest version (as in Hex):
{:addict, ">= 0.1.0"}
Then, I have run mix reps.get and got an error:
Looking up alternatives for conflicting requirements on ecto
From mix.lock: 1.0.0
From addict v0.1.0: ~> 0.9
** (Mix) Hex dependency resolution failed, relax the version requirements or unlock dependencies
I tried to do that in mix.lock but wasn't able to overcome that because this error appeared:
(Mix) Unknown package version ecto v0.0.9 in lockfile
What's the best way to overcome this?
Upvotes: 3
Views: 795
Reputation: 84180
You can set a dependency to override with the override
flag:
defp deps do
...
{:ecto, "~> 1.0.0", override: true},
{:addict, "~> 0.1.0"},
...
end
From the docs:
:override - if set to true the dependency will override any other definitions of itself by other dependencies
This means that even though addict
sets the version to 0.9.0
- the 1.0.0
version will be used. This could cause issues if addict is using a function in Ecto that is now deprecated.
Upvotes: 4