oraios/serena · error · RuntimeError

Found a Perl version but Perl::LanguageServer is not install

Error message

Found a Perl version but Perl::LanguageServer is not installed.
Please install Perl::LanguageServer: cpanm Perl::LanguageServer
See: https://metacpan.org/pod/Perl::LanguageServer

What it means

Raised when a Perl interpreter is found but the Perl::LanguageServer CPAN module is not installed (_get_perl_language_server_version() returns falsy). Perl itself is present; only the language-server module is missing, so the library tells you to install it via cpanm.

Source

Thrown at src/solidlsp/language_servers/perl_language_server.py:107

        valid_platforms = [
            PlatformId.LINUX_x64,
            PlatformId.LINUX_arm64,
            PlatformId.OSX,
            PlatformId.OSX_x64,
            PlatformId.OSX_arm64,
        ]
        if platform_id not in valid_platforms:
            raise RuntimeError(f"Platform {platform_id} is not supported for Perl at the moment")

        perl_version = cls._get_perl_version()
        if not perl_version:
            raise RuntimeError(
                "Perl is not installed. Please install Perl from https://www.perl.org/get.html and make sure it is added to your PATH."
            )

        perl_ls_version = cls._get_perl_language_server_version()
        if not perl_ls_version:
            raise RuntimeError(
                "Found a Perl version but Perl::LanguageServer is not installed.\n"
                "Please install Perl::LanguageServer: cpanm Perl::LanguageServer\n"
                "See: https://metacpan.org/pod/Perl::LanguageServer"
            )

        return "perl -MPerl::LanguageServer -e 'Perl::LanguageServer::run'"

    @staticmethod
    def _resolve_filter_settings(solidlsp_settings: SolidLSPSettings) -> tuple[list[str], list[str]]:
        """Resolve the ``fileFilter`` / ``ignoreDirs`` to hand to Perl::LanguageServer.

        Reads optional overrides from ``ls_specific_settings["perl"]`` (keys ``file_filter`` and
        ``ignore_dirs``); falls back to the defaults otherwise. Extracted as a pure function so the
        configuration plumbing can be unit-tested without starting the language server.
        """
        perl_settings = solidlsp_settings.get_ls_specific_settings(LanguageServerId.PERL)
        file_filter = perl_settings.get("file_filter", list(_DEFAULT_FILE_FILTER))
        ignore_dirs = perl_settings.get("ignore_dirs", list(_DEFAULT_IGNORE_DIRS))

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Install the module: `cpanm Perl::LanguageServer` (install cpanm first via `curl -L https://cpanmin.us | perl - -- App::cpanminus` if needed).
  2. Verify with `perl -MPerl::LanguageServer -e 'print $Perl::LanguageServer::VERSION'` that the module loads in the same perl that launches the server.
  3. If using perlbrew/plenv, run cpanm under the SAME perl that will be used at runtime (`perlbrew use <ver> && cpanm Perl::LanguageServer`).
  4. On distros with packages, `apt install libperl-language-server-perl` may work instead of cpanm.

Example fix

// before (shell)
perl -v  # ok
python -m app  # Perl::LanguageServer missing
// after
cpanm Perl::LanguageServer
perl -MPerl::LanguageServer -e '1' && python -m app
Defensive patterns

Strategy: validation

Validate before calling

import subprocess
def perl_ls_installed():
    return subprocess.run(
        ["perl", "-MPerl::LanguageServer", "-e", "1"], capture_output=True
    ).returncode == 0

Prevention

When it happens

Trigger: Instantiating the Perl language server where `perl -MPerl::LanguageServer -e ...` fails (module not in @INC) — e.g. system perl without the module, or a perlbrew switch lacking it.

Common situations: Fresh perl install without the module; using a different perl (perlbrew/plenv/system) than the one where the module was installed; module installed under a lib path not in @INC; minimal image where cpanm was never run.

Related errors


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