简体   繁体   中英

Elixir version error when running Mix docs

Kindly help with this iisue. I do have system installed Elixir which is version 1.3 and I using asdf.

Here is mix.exs file https://pastebin.com/wd9jPGdq

 [ElixirLS]
an exception was raised:
    ** (Mix.ElixirVersionError) You're trying to run :cards on Elixir v1.3.3 but it has declared in its mix.exs file it supports only Elixir ~> 1.6
        (mix) lib/mix/tasks/loadpaths.ex:51: Mix.Tasks.Loadpaths.check_elixir_version/2
        (mix) lib/mix/tasks/loadpaths.ex:26: Mix.Tasks.Loadpaths.run/1
        (mix) lib/mix/task.ex:296: Mix.Task.run_task/3
        (mix) lib/mix/tasks/compile.ex:83: Mix.Tasks.Compile.run/1
        (mix) lib/mix/task.ex:296: Mix.Task.run_task/3
        (language_server) lib/language_server/build.ex:162: ElixirLS.LanguageServer.Build.compile/0
        (language_server) lib/language_server/build.ex:22: anonymous fn/2 in ElixirLS.LanguageServer.Build.build/3
        (stdlib) timer.erl:166: :timer.tc/1

You can either downgrade the elixir requirement in your mix file and try compiling it again. In your mix.exs file, change:

...
version: "0.1.0",
elixir: "~> 1.6",
start_permanent: Mix.env() == :prod,
...

To

...
version: "0.1.0",
elixir: "~> 1.3",
start_permanent: Mix.env() == :prod,
...

Then run the following in your terminal:

mix do clean, deps.clean --all
mix deps.get
mix compile

OR, you can upgrade the elixir version installed in your machine.

Follow this link to learn how to install/upgrade elixir. Instructions for installing and upgrading elixir using asdf are here and here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM