Friday, March 18, 2022

Elixir: Emacs lsp-mode: Unchecked dependencies for environment test

Source: https://github.com/elixir-lsp/vscode-elixir-ls/issues/132#issuecomment-743332723
Sometimes, the lsp-mode of Emacs remains stubbornly stuck on an error like:
MIX_ENV: test
MIX_TARGET: host
Unchecked dependencies for environment test:
* decimal (Hex package)
  the dependency does not match the requirement "~> 1.0", got "2.0.0"

18:56:16.378 [error] Process #PID<0.122.0> raised an exception
** (Mix.Error) Can't continue due to errors on dependencies
    (mix 1.13.1) lib/mix.ex:515: Mix.raise/2
    (mix 1.13.1) lib/mix/tasks/deps.loadpaths.ex:34: Mix.Tasks.Deps.Loadpaths.run/1
    (mix 1.13.1) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.1) lib/mix/tasks/loadpaths.ex:40: Mix.Tasks.Loadpaths.run/1
    (mix 1.13.1) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.1) lib/mix/tasks/compile.ex:123: Mix.Tasks.Compile.run/1
    (mix 1.13.1) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (language_server 0.8.2) lib/language_server/build.ex:200: ElixirLS.LanguageServer.Build.compile/0

In order to get out of this situation, do
> rm -rf .elixir_ls/build