Don Fox
Don Fox

Reputation: 11

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.

Upvotes: 0

Views: 1418

Answers (2)

Don Fox
Don Fox

Reputation: 11

The issues I was having with were resolved by running "mix local.hex" and, while I was in the mix project, "rm -rf _build deps"

Upvotes: 1

Adam Millerchip
Adam Millerchip

Reputation: 23091

I think you answered your own question. Which OTP version are you using? Your elixir version was compiled with OTP 25, but it doesn't mean you have OTP 25 installed, which could be the problem.

See https://stackoverflow.com/a/71000268/1225617 to install a specific Erlang version.

Upvotes: 1

Related Questions