0

请帮助解决此问题。我确实安装了版本 1.3 的 Elixir 并且我使用 asdf。

这是 mix.exs 文件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
4

1 回答 1

0

您可以降级混合文件中的长生不老药要求,然后再次尝试编译。在您的 mix.exs 文件中,更改:

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

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

然后在您的终端中运行以下命令:

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

或者,您可以升级您机器中安装的 elixir 版本。

按照此链接了解如何安装/升级 elixir。使用 asdf 安装和升级 elixir 的说明在这里这里

于 2018-07-07T23:21:44.087 回答