Tried installing Elixir to Windows with 'choco install elixir' - but 'elixir' command not found? Path?

I just tried installing Elixir to a new Windows computer using ‘choco install elixir’ from an elevated command prompt, which is one of the recommended methods:

This installed it okay. If I try running the command a second time, it tells me: “Warning: Elixir v1.17.3 already installed”. So it is installed.

But running the command iex or elixir --v or mix tells me each of these “is not recognized as an internal or external command”.

By contrast erl gives me an “Eshell” successfully so that seems to be working.

Is there some manual step needed to set Elixir commands to PATH? I can do this here: What is Windows PATH and How Do You Add to and Edit it? - Make Tech Easier

I see I have a C:\Program Files\Erlang OTP folder that seems to have that and obviously that is working if erl works.

But how do I make the elixir and iex and mix commands work?

According to this I presume I should have a C:\Program Files\Elixir\bin to add to PATH but I don’t have that folder at all.

Is choco a defective method? Or what?

Edit: I have tried to run choco install elixir --force to force a reinstall and interestingly I am getting a 503 error saying servers are at capacity. So I presume choco is broken right now. I will try another method.

I do not use Windows. I presume though that this choco command installed elixir somewhere on your harddisk.
Try and find that path and add it to PATH environment variable.
That should work.
Or check out @wojtekmach 's installers on https://elixir-install.org/

Often you need to call refreshenv after installing things with chocolatey, or close the shell and open a new one

In my experience, scoop is much more enjoyable than chocolatey.

This is old however I will answer this anyway.

When running the command “choco install elixir -y” on Windows 11. Chocolatey will install elixir in this folder: “C:\ProgramData\chocolatey\lib\elixir\tools\bin”

Add this to your system path: “C:\ProgramData\chocolatey\lib\elixir\tools\bin”

Now check the installed version with: “elixir -v”

1 Like