Suricopathe

Suricopathe

Hello everyone,
I am pretty new to the Elixir world and at the same time, I feel like I fall in love with the language, the ecosystem around it and the community.

Currently, I am trying to follow basic elixir exercise and will try to improve upon playing with the Phoenix server and maybe LiveView as well.

So far, I have setup my environment :

  • Installed Erlang OTP (27.1) (Directly downloading the Windows installer from the website)
  • Installed Elixir (1 .17.3) (Directly downloading the Windows installer from the website)
  • Installed the ElixirLS VSCode extension (v0.23.1)
  • Opening an Elixir project in VSCode (Basic exercise for Exercism : Hello World in Elixir on Exercism

At this point I have the following error :

When I take a look at the PATH that is logged, I can see the bin directories of both my elixir and erlang installation.

[Extension Host] Failed to run ‘elixir’ command. Current process’s PATH: C:\Program Files\Exercism;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Elixir\bin;C:\Program Files\Erlang OTP\bin

(I trimmed the path logged of unnecessary other paths, to ease readability)

The ElixirLS VSCode extension doesn’t work and it’s a pain to not have a good code editor working properly.
I already tried to restart my laptop several times, uninstall and re-installing everything from scratch.

Do someone experience the same issue ? Can somebody have another idea that I cant see ?

Thank you for your help :slight_smile:

Showing Posts 1 to 8

krwenholz

krwenholz

If you open the interactive terminal, can you run elixir in there? I’ve found debugging path locations from that terminal to be helpful. I install elixir and friends in a devcontainer with nix, so I’ve hit path issues a number of times.

You might also try running > Reload Window. I know you’ve rebooted, but the window reload can pick up env changes that happen after VSCode starts (a “common” issue for nix+devcontainer).

Suricopathe

Suricopathe OP

Hi!
Thank you for taking the time to help! :slight_smile:

So to add information based on your answer

  1. Yes, I am able to use the elixir CLI from within the VScode terminal. And of course from other terminal outside VScode without any issue.

  2. I did try the ‘Reload the window’ action from VScode without any change. Upon the extensions startup I still have the same error message as in my first post.

FYI, I saw on another post it might come from Windows path with blank in the middle (like “Program Files”). So in one of my previous attempt, I already tried to put the Elixir folder in another folder like (C:/ElixirFolder/Elixir) and put that path in my environment variable. I ended up with the same error message AND the path without blank logged in the error log available in the VSCode developer console.

Somehow, the PATH is good but the elixir command cannot be run…

Is it possible that I have to give particular permissions to the elixirLS extensions ? Or VScode ?
I am out of ideas :smiley:

krwenholz

krwenholz

I wish I were of more help haha.

Things to consider:

  • Which version of the extension are you on? Last release was August 10, so I suspect you aren’t behind, but I see several mentions of Windows in there.
  • VSCode version?

You could also dig through the issues for anything Windows or path related, but ¯_(ツ)_/¯

itzmidinesh

itzmidinesh

Do you have any other elixir related extensions installed in VS code? Also, are you able to use elixir -v and erl in terminal outside of VS code?

psantos

psantos

I guess the problem is that, ExlirLS is trying to run elixir as elixir instead of elixir.bat since you are on windows.

First, navigate to: C:\Program Files\Elixir\bin and check how the executable is named.

With ElixirLS you can have a setup file. Try to find this file: %APPDATA%\elixir_ls\setup.bat and examine the content in there. Make sure everything there is correct.

Suricopathe

Suricopathe OP

Hello,
Thank you for the different answers. Let me add some info :

@krwenholz

  • VS Code version : 1.93.1
  • Extension ElixirLS version : v.0.23.1

I digged a bit but nothing really helpful unfortunately :frowning:

@itzmidinesh
This is the only Elixir related extension in my VS Code setup. And yes I am able to use the erl and elixir command in my windows CMD, as well as my powershell and my git bash terminal. Either inside or outside of VS Code.
And it works like a charm :slight_smile:

@psantos Thank you this might be a good hint. But I can’t found the %APPDATA%/elixir_ls folder. It is not created in my %APPDATA% folder. Either the server crash before going to the step where it created this cache folder.
Either there is something else during the execution preventing the creation of it.

Do you have more insights when this elixir_ls folder is created ?

Thank you for your support :slight_smile:

itzmidinesh

itzmidinesh

Can you check if you have any custom settings for ElixirLS setup in VS codes setttings.json?

Also, is this error happening in all projects? Try setting up a new phoenix/Elixir project from terminal and then open in VS code.

v4rm4n

v4rm4n

Faced the same issue on Windows, with a similar setup for Erlang and Elixir.

Running VScode as admin (or spawning via code . from an Administrator Powershell) solved it for me.

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews