oraios/serena · error · FileNotFoundError

elm-language-server executable not found at {elm_ls_executab

Error message

elm-language-server executable not found at {elm_ls_executable_path}, something went wrong with the installation.

What it means

Serena manages the elm-language-server binary under a managed-dependencies directory. After attempting to install the language server (and Elm compiler if missing), _setup_runtime_dependencies checks the executable exists; if not, installation failed silently and it raises FileNotFoundError indicating the install went wrong.

Source

Thrown at src/solidlsp/language_servers/elm_language_server.py:126

        )

        # legacy unversioned dir reserved for INITIAL pair; any other version combination goes into a versioned subdir
        is_initial = (
            elm_language_server_version == INITIAL_ELM_LANGUAGE_SERVER_VERSION and elm_compiler_version == INITIAL_ELM_COMPILER_VERSION
        )
        ls_dirname = "elm-lsp" if is_initial else f"elm-lsp-{elm_language_server_version}-{elm_compiler_version}"
        elm_ls_dir = os.path.join(cls.ls_resources_dir(solidlsp_settings), ls_dirname)
        elm_ls_executable_path = os.path.join(elm_ls_dir, "node_modules", ".bin", "elm-language-server")
        if not os.path.exists(elm_ls_executable_path):
            log.info(f"Elm Language Server executable not found at {elm_ls_executable_path}. Installing...")
            with LogTime("Installation of Elm language server dependencies", logger=log):
                deps.install(elm_ls_dir)
        elif not system_elm:
            log.info("Elm compiler not found on PATH. Installing a managed Elm compiler...")
            with LogTime("Installation of Elm compiler dependency", logger=log):
                deps.install(elm_ls_dir)

        if not os.path.exists(elm_ls_executable_path):
            raise FileNotFoundError(
                f"elm-language-server executable not found at {elm_ls_executable_path}, something went wrong with the installation."
            )
        return [elm_ls_executable_path, "--stdio"]

    def _create_base_initialize_params(self) -> dict:
        """
        Returns the initialize params for the Elm Language Server.
        """
        initialize_params = {
            "locale": "en",
            "capabilities": {
                "textDocument": {
                    "synchronization": {"didSave": True, "dynamicRegistration": True},
                    "completion": {"dynamicRegistration": True, "completionItem": {"snippetSupport": True}},
                    "definition": {"dynamicRegistration": True},
                    "references": {"dynamicRegistration": True},
                    "documentSymbol": {

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Delete Serena's managed elm-language-server directory (the elm_ls_dir under the managed dependencies cache) and retry so a fresh install runs
  2. Ensure Node.js and npm are installed and on PATH (node --version, npm --version), then restart Serena
  3. Check network/proxy settings if the download failed (set HTTPS_PROXY etc.)
  4. Verify file permissions on the managed dependencies directory allow writing

Example fix

// before
$ rm -rf ~/.serena/language_servers/static/elm-language-server   # partially installed
// after
$ rm -rf ~/.serena/language_servers/static/elm-language-server   # force clean reinstall
$ # restart Serena; it re-downloads and validates the executable
Defensive patterns

Strategy: try-catch

Validate before calling

import os
def elm_ls_installed(managed_dir: str) -> bool:
    exe = os.path.join(managed_dir, "node_modules", ".bin", "elm-language-server")
    return os.path.exists(exe) and os.access(exe, os.X_OK)

Type guard

def executable_exists(path: str) -> bool:
    import os
    return os.path.isfile(path) and os.access(path, os.X_OK)

Try / catch

try:
    server = LanguageServer.create(LanguageServerId.ELM, ...)
except FileNotFoundError as e:
    logger.error("Elm LS install broken: %s", e)
    clear_managed_deps_dir_and_retry()  # wipe cache and let Serena reinstall

Prevention

When it happens

Trigger: Starting the Elm language server when the managed elm-language-server executable is absent at the expected path after deps.install(elm_ls_dir) ran — download failure, wrong Node/npm setup, partial install, or corrupted dependency directory.

Common situations: Offline/proxied environments where the npm download fails; global npm misconfiguration; deleting or wiping Serena's managed language-server cache directory mid-install; running as a user without write permission to the install directory.

Related errors


AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29). Data as JSON: /api/errors/3dea237b50ef7753. Report an issue: GitHub.