I get a list of what looks like phoenix dependency errors when I run mix help in the command line

I have reinstalled elixir and erlang but I’m still getting the following when I enter

mix help

into the command line.

[error] beam\beam_load.c(148): Error loading module ‘Elixir.Mix.Tasks.Local.Phoenix’:
please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version

[error] beam\beam_load.c(148): Error loading module ‘Elixir.Mix.Tasks.Local.Phx’:
please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version

[error] beam\beam_load.c(148): Error loading module ‘Elixir.Mix.Tasks.Phoenix.New’:
please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version

[error] beam\beam_load.c(148): Error loading module ‘Elixir.Mix.Tasks.Phx.New’:
please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version

[error] beam\beam_load.c(148): Error loading module ‘Elixir.Mix.Tasks.Phx.New.Ecto’:
please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version

[error] beam\beam_load.c(148): Error loading module ‘Elixir.Mix.Tasks.Phx.New.Web’:
please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version

Have you tried the good old classic?

# From your project's root directory
rm -rf _build deps
mix do deps.get, compile

Oh but I’m just starting on project building, would I need to do this?

I don’t even think I’ve built a project yet. This (mix help) is literally the first mix command I’ve been taught.

Well, it’s just something that’s usually safe to do. Have you tried?

I would like to try but I don’t know what my project is.

Do I need to explicitly declare a project using mix before I got use that command?

Dude, no, just cd where/your/project/root/is and then execute the commands.

The error obviously states mismatch between precompiled version of elixir and erlang.

How have you installed elixir and erlang?
I would strongly recommend to use asdf and install the latest available versions:

erlang 26.2.1
elixir 1.16.0-otp-26
1 Like

I’ve done this but the commands aren’t recognised, I’m on windows by the way.

I uninstalled and reinstalled using windows installer both erlang and elixir

Ah windows, never mind. I would double check the path to see if maybe the old binaries are still present.

So frustrating. I have uninstalled reinstalled restarted my computer so many times.

I have also manually deleted folders and have removed dependencies from vscode.

The same error persists.

15:00:53.492 [error] beam\beam_load.c(148): Error loading module 'Elixir.Mix.Tasks.Local.Phoenix':
  please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version



15:00:53.492 [error] beam\beam_load.c(148): Error loading module 'Elixir.Mix.Tasks.Local.Phx':
  please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version



15:00:53.496 [error] beam\beam_load.c(148): Error loading module 'Elixir.Mix.Tasks.Phoenix.New':
  please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version



15:00:53.497 [error] beam\beam_load.c(148): Error loading module 'Elixir.Mix.Tasks.Phx.New':
  please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version



15:00:53.499 [error] beam\beam_load.c(148): Error loading module 'Elixir.Mix.Tasks.Phx.New.Ecto':
  please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version



15:00:53.500 [error] beam\beam_load.c(148): Error loading module 'Elixir.Mix.Tasks.Phx.New.Web':
  please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version


mix                   # Runs the default task (current: "mix run")
mix app.config        # Configures all registered apps
mix app.start         # Starts all registered apps
mix app.tree          # Prints the application tree
mix archive           # Lists installed archives
mix archive.build     # Archives this project into a .ez file
mix archive.install   # Installs an archive locally
mix archive.uninstall # Uninstalls archives
mix clean             # Deletes generated application files
mix cmd               # Executes the given command
mix compile           # Compiles source files
mix deps              # Lists dependencies and their status
mix deps.clean        # Deletes the given dependencies' files
mix deps.compile      # Compiles dependencies
mix deps.get          # Gets all out of date dependencies
mix deps.tree         # Prints the dependency tree
mix deps.unlock       # Unlocks the given dependencies
mix deps.update       # Updates the given dependencies
mix do                # Executes the tasks separated by plus
mix escript           # Lists installed escripts
mix escript.build     # Builds an escript for the project
...

Thank God.

I was able to track down the problem, using this thread and some .ex fetching with that old program that can grab modules and functions.

The solution, for future reference and anyone else in need, is in finding the .mix folder.

This is completely separate from the elixir/lib folders. Mine was located at C:\Users/Username/.mix . Therein should be an archive folder. Now inside the archives folder was a folder called phx_new, which was actually very old and outdated.

I removed the folder and the error was fixed. This folder did not get removed during uninstall as it was not part of the main env configuration directory tree.

2 Likes

Thanks for following up and leaving future reference. :heart:

1 Like