oraios/serena · error · FileNotFoundError

nomicfoundation-solidity-language-server executable not foun

Error message

nomicfoundation-solidity-language-server executable not found at {solidity_executable_path}. Something went wrong with the installation.

What it means

After SolidLSP installs the Solidity language server dependencies, it verifies the expected nomicfoundation-solidity-language-server binary exists on disk. If the post-install check fails, _get_or_install_core_dependency raises FileNotFoundError indicating the installation did not produce the executable — an install integrity failure, not a missing-implementation error.

Source

Thrown at src/solidlsp/language_servers/solidity_language_server.py:141

                ]
            )

            solidity_ls_dir = self._resolve_solidity_ls_dir(solidity_language_server_version, forge_version)
            managed_bin_dir = os.path.join(solidity_ls_dir, "node_modules", ".bin")
            solidity_executable_path = os.path.join(managed_bin_dir, "nomicfoundation-solidity-language-server")
            forge_executable_path = os.path.join(managed_bin_dir, "forge")

            if os.name == "nt":
                solidity_executable_path += ".cmd"
                forge_executable_path += ".cmd"

            if not os.path.exists(solidity_executable_path) or not os.path.exists(forge_executable_path):
                log.info("Solidity Language Server dependencies missing. Installing...")
                deps.install(solidity_ls_dir)
                log.info("Solidity language server dependencies installed successfully.")

            if not os.path.exists(solidity_executable_path):
                raise FileNotFoundError(
                    f"nomicfoundation-solidity-language-server executable not found at {solidity_executable_path}. "
                    "Something went wrong with the installation."
                )

            return solidity_executable_path

        @staticmethod
        def _get_forge_npm_package() -> str:
            """
            Returns the platform-specific @foundry-rs forge npm subpackage name. Installing
            the meta-package fails on Windows due to a POSIX-only postinstall script.
            """
            machine = platform.machine().lower()
            if machine in ("x86_64", "amd64"):
                arch = "amd64"
            elif machine in ("arm64", "aarch64"):
                arch = "arm64"
            else:

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Delete the solidity language-server install directory and let the library reinstall (fresh deps.install).
  2. Run the underlying npm install manually in that directory to see the real npm error.
  3. Check disk space and that the install path is writable.
  4. Verify Node/npm versions meet the package's requirements and the platform/arch binary is published for your OS.

Example fix

// before: corrupted install dir
rm -rf ~/.solidlsp/solidity-lang-server
// after: clean reinstall happens on next init
python -c "from solidlsp import SolidLSP; ..."  # triggers fresh install
Defensive patterns

Strategy: try-catch

Validate before calling

import os
from solidlsp.language_servers.solidity_language_server import _get_ls_dir  # or your resolved dir
exe = os.path.join(solidity_ls_dir, "node_modules", ".bin", "nomicfoundation-solidity-language-server")
if not os.path.exists(exe):
    import shutil
    shutil.rmtree(solidity_ls_dir, ignore_errors=True)  # force clean reinstall

Type guard

def solidity_ls_installed(install_dir: str, exe_name: str) -> bool:
    import os
    return os.path.exists(os.path.join(install_dir, "node_modules", ".bin", exe_name))

Try / catch

try:
    server = SolidityLanguageServer(config, repo_root, settings)
except FileNotFoundError as e:
    if "executable not found" in str(e):
        shutil.rmtree(solidity_ls_dir, ignore_errors=True)
        server = SolidityLanguageServer(config, repo_root, settings)  # clean reinstall
    else:
        raise

Prevention

When it happens

Trigger: Constructing the Solidity language server when, despite running deps.install(solidity_ls_dir), the binary at solidity_executable_path is absent: npm install partially failed, wrong install dir, platform-specific binary skipped, or a prior corrupted install cached.

Common situations: Disk-full or interrupted npm installs, restricted filesystems (read-only npm cache/npm_config_prefix), npm proxy misconfigurations, or Windows/ARM environments where the package's platform binary is unavailable.

Related errors


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