Elixir and Mix commands are not working

Hello all,

I’m trying to start my server by running mix phx.server but I get this in the terminal

No version is set for command mix
Consider adding one of the following versions in your config file at 
elixir 1.14.2-otp-25
elixir 1.14.4-otp-25

So after some research, I tried to add the version number in the mix.exs file by doing this

def project do
    # ...
    elixir: "1.14.4-otp-25",
    # ...

But still no luck, no iex, mix, or elixir commands in the terminal work, I would really appreciate some help.

This error is not coming from elixir, but likely asdf, which manages you elixir installation.

Hey @Daniel1 to elaborate on @LostKobrakai 's point, you need to tell asdf what version to use. Something like:

asdf global elixir 1.14.4-otp-25

to set the global default, or

asdf local elixir 1.14.4-otp-25

to set it in a .tool_versions file in the current directory.

Once you’ve done that you’ll want to change your mix.exs back to a regular "1.14.4" since mix.exs doesn’t know anything about the whole -otp-25 thing that asdf adds.

many thanks the help!