Creating an Elixir project generates: [error] beam/beam_load.c(148): Error loading module 'Elixir.Hex'

In the terminal elixir -v returns: “Elixir 1.14.3 (compiled with Erlang/OTP 25)”

The above error msg. comes with the instruction to " please re-compile this module with an Erlang/OTP 25 compiler".

I also get this error:

“[error] Loading of /Users/donfox1/.mix/archives/hex-0.17.1/hex-0.17.1/ebin/Elixir.Mix.Tasks.Hex.Outdated.beam failed: :badfile”

The project is created but using mix compile fails to compile and repeats the above error while iex -S mix may occasionally work and also repeats the same errors.

Project files run in iex after compiling the files separately.

I reinstalled elixir and erlang from homebrew and attempted to find the solution on line. This and similar errors are usually attributed to using an OTP that’s less than 25.

Hi @donfox I would mix local.hex and also if you’re in a mix project I would rm -rf _build deps and see if recompiling helps.

2 Likes

This clears up the problems i was having with mix! Thanks!