# Failed to run 'elixir' command error in vs code

**URL:** <https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047>\
**Category:** Questions\
**Tags:** vscode, elixir-ls\
**Created:** [April 28, 2020, 2:47am UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047 "2020-04-28T02:47:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![freewebwithme](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/freewebwithme/32/17761_2.png) [@freewebwithme](https://forum.elixirforum.com/u/freewebwithme)\
**Post date:** [April 28, 2020, 2:47am UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/1 "2020-04-28T02:47:55Z")

</div>

Using vs code and installed ElixirLS: support and debugger.  
And I got an error popped up on start up says

> Failed to run ‘elixir’ command. ElixirLS will probably fail to launch. Logged PATH to Development Console.

I think elixir command is in current path

```elixir
which elixir
/home/user/.asdf/shims/elixir

```

and

```elixir
echo $PATH
...........:/home/user/.asdf/shims:.....................
What is my problem?
```

---

<div class="post-metadata">

**Author:** ![axelson](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/32/26351_2.png) [@axelson](https://forum.elixirforum.com/u/axelson)\
**Post date:** [April 28, 2020, 2:53am UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/2 "2020-04-28T02:53:35Z")

</div>

Can you show the full error output? Also what operating system are you using?

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [April 28, 2020, 7:19am UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/3 "2020-04-28T07:19:21Z")

</div>

How do you start VScode?

It might have a different view to your `PATH` than your shell, especially if you start it from a graphical environment rather from the terminal.

Please check the `PATH` logged into the console as explained by the error.

Please also check if the error persists when starting VScode from within a terminal that already is in the projects folder if you do not already open it that way. Depending on your operating system/flavor of it, you might need to run one of `vscode .` or `code .`.

---

<div class="post-metadata">

**Author:** ![freewebwithme](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/freewebwithme/32/17761_2.png) [@freewebwithme](https://forum.elixirforum.com/u/freewebwithme)\
**Post date:** [April 28, 2020, 2:40pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/4 "2020-04-28T14:40:24Z")

</div>

full error output is this.

> Failed to run ‘elixir’ command. ElixirLS will probably fail to launch. Logged PATH to Development Console.

and I am using manjaro linux

---

<div class="post-metadata">

**Author:** ![freewebwithme](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/freewebwithme/32/17761_2.png) [@freewebwithme](https://forum.elixirforum.com/u/freewebwithme)\
**Post date:** [April 28, 2020, 2:46pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/5 "2020-04-28T14:46:05Z")

</div>

Yes you are right. Starting vs code from gui only shows error, and starting fro terminal using `code .` works fine

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [April 28, 2020, 3:00pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/6 "2020-04-28T15:00:07Z")

</div>

You probably add `asdf` only to the `PATH` in your shells RC file.

To make it available to your GUI as well you neet to add it to your `.Xprofile` or whatever is read by your GUI.

---

<div class="post-metadata">

**Author:** ![cblavier](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cblavier/32/29763_2.png) [@cblavier](https://forum.elixirforum.com/u/cblavier)\
**Post date:** [July 6, 2020, 12:51pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/7 "2020-07-06T12:51:26Z")

</div>

How can you do it under MacOS ?

---

<div class="post-metadata">

**Author:** ![Facundo](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/facundo/32/15596_2.png) [@Facundo](https://forum.elixirforum.com/u/Facundo)\
**Post date:** [November 25, 2020, 12:13pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/8 "2020-11-25T12:13:38Z")

</div>

Same problem for me with Gui on Mac & zsh.  
No luck adding `$HOME/.asdf/shims` to `PATH` neither on `$HOME/.zshenv` nor `$HOME/.zprofile`

---

<div class="post-metadata">

**Author:** ![lukaszsamson](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lukaszsamson/32/7671_2.png) [@lukaszsamson](https://forum.elixirforum.com/u/lukaszsamson)\
**Post date:** [November 26, 2020, 10:45am UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/9 "2020-11-26T10:45:10Z")

</div>

`$HOME/.zshrc` works for me

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [November 26, 2020, 2:45pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/10 "2020-11-26T14:45:27Z")

</div>

Your GUI does not care about settings in `.zshenv` and `.zprofile`, both of them are used by `zsh` only.

Though if your installed version of Elixir-LS is recent enough (I think it became added in 0.3.0 or 0.4.0), then `asdf` should be found by it if `$HOME/.asdf/asdf.sh` exists.

[https://github.com/elixir-lsp/elixir-ls/blob/3c1085bc90f47141d1286cfabddc834bf3127c51/apps/elixir\_ls\_utils/priv/launch.sh#L14](https://github.com/elixir-lsp/elixir-ls/blob/3c1085bc90f47141d1286cfabddc834bf3127c51/apps/elixir_ls_utils/priv/launch.sh#L14)

---

<div class="post-metadata">

**Author:** ![Facundo](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/facundo/32/15596_2.png) [@Facundo](https://forum.elixirforum.com/u/Facundo)\
**Post date:** [November 26, 2020, 3:12pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/11 "2020-11-26T15:12:58Z")

</div>

I saw that as well.

However `asdf.sh` is not there:

```elixir
ls ${HOME}/.asdf/
 installs/  plugins/  repository/  shims/  tmp/

```

I did try creating a link

```elixir
ln -s /usr/local/opt/asdf/asdf.sh asdf.sh

```

But failed miserably because the script points to directories relative to the original `asdf.sh`

I have asdf’s lastest version. And, BTW, this started happening to me in a newly migrated Mac (now) using Big Sur

---

<div class="post-metadata">

**Author:** ![lukaszsamson](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lukaszsamson/32/7671_2.png) [@lukaszsamson](https://forum.elixirforum.com/u/lukaszsamson)\
**Post date:** [November 26, 2020, 5:45pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/12 "2020-11-26T17:45:22Z")

</div>

Does your integrated terminal in vscode have the necessary envs? I guess thats what vscode uses to launch elixir-ls

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [November 26, 2020, 6:52pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/13 "2020-11-26T18:52:04Z")

</div>

Try a local user install as described by asdf rather than some package manager that installs system wide.

---

<div class="post-metadata">

**Author:** ![Facundo](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/facundo/32/15596_2.png) [@Facundo](https://forum.elixirforum.com/u/Facundo)\
**Post date:** [November 29, 2020, 11:33pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/14 "2020-11-29T23:33:28Z")

</div>

Thanks @NobbZ  
Installed `asdf` again from sources –not using brew- and it works smoothly.

@lukaszsamson my integrated terminal is `zsh` and loads every other terminal outside of VSCode.

---

<div class="post-metadata">

**Author:** ![Nefcairon](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nefcairon/32/31921_2.png) [@Nefcairon](https://forum.elixirforum.com/u/Nefcairon)\
**Post date:** [October 6, 2021, 6:10pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/15 "2021-10-06T18:10:05Z")

</div>

Hello,

I am using VS Code via Windows 10/WSL (erlang/elixir installed via asdf) and I also get

```elixir
Failed to run ‘elixir’ command. ElixirLS will probably fail to launch. Logged PATH to Development Console.

```

I even do not know where/what this “Development Console” is (google didn’t help).

Is someone able to help me?

---

<div class="post-metadata">

**Author:** ![Facundo](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/facundo/32/15596_2.png) [@Facundo](https://forum.elixirforum.com/u/Facundo)\
**Post date:** [October 7, 2021, 3:42pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/16 "2021-10-07T15:42:14Z")

</div>

Click on View → Terminal  
Select `output` tab  
Then select ElixirLS from the dropdown

---

<div class="post-metadata">

**Author:** ![wdiechmann](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wdiechmann/32/5725_2.png) [@wdiechmann](https://forum.elixirforum.com/u/wdiechmann)\
**Post date:** [October 8, 2021, 10:09am UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/17 "2021-10-08T10:09:05Z")

</div>

@Facundo I can confirm that! Just \<upgraded\> my MacBook Air M1 to BigSur - and the next thing I noticed was that ElixirLS fails to start in VSCode

my .zshrc is good as is my `asdf local elixir 1.12.0`

I may have installed asdf with brew first - but my current installation is tucked away safely in $HOME/.asdf 🕶

Tried `iex` from CLI only to learn that elixir wasn’t the issue at all - `erl` was! (Note: I run all my workbench stuff in containers which is probably why I haven’t noticed)

Once I got my `asdf global erlang 24.1` out of the way - all was good in VSCode on macOS BigSur land 😄

---

<div class="post-metadata">

**Author:** ![thepeoplesbourgeois](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thepeoplesbourgeois/32/21225_2.png) [@thepeoplesbourgeois](https://forum.elixirforum.com/u/thepeoplesbourgeois)\
**Post date:** [January 31, 2022, 2:50am UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/18 "2022-01-31T02:50:25Z")

</div>

Actually, “development console” in that error refers to ~~Chromium’s~~  ~~Electron’s~~ VSCode’s development tools console, which is under the Help menu header on MacOS, and… might be in a similar enough part of the Windows menu if you dig around for it a bit, @Nefcairon.

 ![development_console](https://forum.elixirforum.com/uploads/default/original/3X/7/4/74b6689075fa93fa242ef64ce872ee8eb6bac07f.jpeg)

---

<div class="post-metadata">

**Author:** ![wallyfoo](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wallyfoo/32/16837_2.png) [@wallyfoo](https://forum.elixirforum.com/u/wallyfoo)\
**Post date:** [February 2, 2022, 1:02pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/19 "2022-02-02T13:02:48Z")

</div>

This ended up being the solution for me here on Groundhog’s Day, 2022. I forgot to set my global erlang asdf.

Rectified, relaunched, resplendent.

---

<div class="post-metadata">

**Author:** ![jmnda](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/j/90db22/32.png) [@jmnda](https://forum.elixirforum.com/u/jmnda)\
**Post date:** [March 9, 2022, 5:20pm UTC](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047/20 "2022-03-09T17:20:53Z")

</div>

Setting `erlang` and `elixir` globally solve the issue for me as well  
`asdf global erlang <your_version>`  
` asdf global elixir <your_version>`

[Next page](https://forum.elixirforum.com/t/failed-to-run-elixir-command-error-in-vs-code/31047.md?page=2)
