[英]Correct version in mix.exs dependency declaration
I have a mix.exs
file that has some dependencies: 我有一个具有某些依赖项的
mix.exs
文件:
def deps do
[{:nadia, "~> 0.4"}]
end
Let's say I want to change Nadia to version 0.3
. 假设我想将Nadia更改为
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. 将
mix.exs
更改后,我无法获得Nadia的0.3版本。 Neither mix deps.update
nor mix deps.unlock && mix deps.update
help me. mix deps.update
或mix deps.unlock && mix deps.update
对我有帮助。
I'm sure there's a way to do this; 我敢肯定有办法做到这一点; I just couldn't find it.
我只是找不到。
Thanks in advance! 提前致谢!
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 ). 要求
~> 0.3
给出0.4.0
的原因是因为~> 0.3
等于>= 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
: 如果要
>= 0.3.0 and < 0.4.0
,则需要使用条件~> 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
. 一个简单的
mix deps.get
更改后mix.exs
会给你最新的0.3.x
版本nadia
。 There's no need to run mix deps.unlock
or mix deps.update
. 无需运行
mix deps.unlock
或mix deps.update
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.