Setting up IDE to use nmake to compile elixir librairies through the ElixirLSP

Hello, I’ve encountered issues using Elixir on Windows 11. The issue is with with the mix commands. The problem arises in the context of a Phoenix framework project, but since the issue does not seem tied to Phoenix itself, I’ve choosen to post this thread in the Elixir forums.

Issue

Running the mix compile commands yields an error message suggesting to use the MVS community build tools to compile the bcrypt library. The compiler provides advice to open a command prompt with a specific batch file (vcvarsall.bat). This works to compile code, but as the Elixir LSP extension for VSCode does not run in this specific environement, i don’t have access to the extension, which is limiting productivity-wise.

Is this a known issue for windows users and are there any fixes ? (My linux distro was broken by a recent update I need a fallback solution in the meantime)

Thanks in advance.

You need to be in one of the developer command prompt/powershell consoles.

There are various posts around the web on how to do this, e.g. here and here.

This is what I have in my vscode config file:

  "terminal.integrated.defaultProfile.windows": "vsbuild_pwsh",
  "terminal.integrated.automationProfile.windows": {
    "path": "pwsh.exe"
  },
  "terminal.integrated.profiles.windows": {
    "vsbuild_pwsh": {
      "args": [
        "-NoExit",
        "-Command",
        "$vsPath = & \"${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe\" -products * -latest -property installationpath; Import-Module \"$vsPath/Common7/Tools/Microsoft.VisualStudio.DevShell.dll\"; Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation"
      ],
      "source": "PowerShell",
      "icon": "terminal-powershell"
    }