{"record":{"id":"80ea3420d7107fca","repo":"oraios/serena","slug":"typescript-language-server-executable-not-found-at","errorCode":null,"errorMessage":"typescript-language-server executable not found at {tsserver_executable_path}, something went wrong with the installation.","messagePattern":"typescript-language-server executable not found at (.+?), something went wrong with the installation\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/typescript_language_server.py","lineNumber":332,"sourceCode":"            assert is_npm_installed, \"npm is not installed or isn't in PATH. Please install npm and try again.\"\n\n            # legacy unversioned dir reserved for INITIAL pair; any other version combination goes into a versioned subdir\n            is_initial = (\n                typescript_version == INITIAL_TYPESCRIPT_VERSION\n                and typescript_language_server_version == INITIAL_TYPESCRIPT_LANGUAGE_SERVER_VERSION\n            )\n            ls_dirname = \"ts-lsp\" if is_initial else f\"ts-lsp-{typescript_version}-{typescript_language_server_version}\"\n            tsserver_ls_dir = os.path.join(self._ls_resources_dir, ls_dirname)\n            tsserver_executable_path = os.path.join(tsserver_ls_dir, \"node_modules\", \".bin\", \"typescript-language-server\")\n\n            if not os.path.exists(tsserver_executable_path):\n                log.info(f\"Typescript Language Server executable not found at {tsserver_executable_path}. Installing...\")\n                with LogTime(\"Installation of TypeScript language server dependencies\", logger=log):\n                    deps.install(tsserver_ls_dir)\n                log.info(\"TypeScript language server dependencies installed successfully\")\n\n            if not os.path.exists(tsserver_executable_path):\n                raise FileNotFoundError(\n                    f\"typescript-language-server executable not found at {tsserver_executable_path}, something went wrong with the installation.\"\n                )\n            return tsserver_executable_path\n\n        def _create_launch_command(self, core_path: str) -> list[str]:\n            return [core_path, \"--stdio\"]\n\n    def _get_language_id_for_file(self, relative_file_path: str) -> str:\n        # JSX is parsed as TS without this, which silently truncates symbol\n        # ranges at the first multi-line JSX expression.\n        if relative_file_path.endswith(\".tsx\"):\n            return \"typescriptreact\"\n        if relative_file_path.endswith(\".jsx\"):\n            return \"javascriptreact\"\n        return self.language_id\n\n    def _create_base_initialize_params(self) -> dict:\n        initialize_params = {","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/typescript_language_server.py#L314-L350","documentation":"Thrown as FileNotFoundError when, after running the dependency installer for the typescript-language-server npm package, the expected tsserver executable still does not exist on disk at tsserver_executable_path. It indicates the automated installation step completed without producing the binary the server launch needs.","triggerScenarios":"Calling SolidLSP for TypeScript triggers _get_or_install_core_dependency; deps.install(tsserver_ls_dir) runs but the tsserver executable is still absent when re-checked with os.path.exists.","commonSituations":"npm install silently failing behind a corporate proxy or with bad registry config; disk full; installing into a directory without write/execute permissions; partial installs left over from an interrupted run; native binary download blocked by antivirus.","solutions":["Delete the typescript language server install directory and retry, letting deps.install run fresh.","Run the npm install manually (npm install -g typescript typescript-language-server) and check npm/network errors.","Verify network/proxy/registry settings (npm config get registry; corporate proxy env vars).","Check disk space and directory write permissions for the install location.","If a global install exists, configure ls_path/ls_specific_settings to point at it and bypass auto-install."],"exampleFix":"// before: relying on auto-install that fails behind a proxy\nls = SolidLSP(\"ts\", \"/repo\")\n// after: pre-install and point the server at the binary\n// $ npm install -g typescript typescript-language-server\nsettings = {\"ls_specific_settings\": {\"typescript\": {\"ls_path\": \"/usr/local/bin/typescript-language-server\"}}}\nls = SolidLSP(\"ts\", \"/repo\", settings)","handlingStrategy":"try-catch","validationCode":"import os, shutil\nif not (os.path.exists(expected_tsserver_path) or shutil.which(\"typescript-language-server\")):\n    # pre-install before constructing the server\n    subprocess.run([\"npm\", \"install\", \"-g\", \"typescript\", \"typescript-language-server\"], check=True)","typeGuard":"def has_ts_ls(path: str) -> bool:\n    return os.path.isfile(path) and os.access(path, os.X_OK)","tryCatchPattern":"try:\n    ls = SolidLSP(\"typescript\", repo_path)\nexcept FileNotFoundError as e:\n    if \"typescript-language-server executable not found\" in str(e):\n        subprocess.run([\"npm\", \"install\", \"-g\", \"typescript\", \"typescript-language-server\"], check=True)\n        ls = SolidLSP(\"typescript\", repo_path)\n    else:\n        raise","preventionTips":["Pre-install language servers in your image/environment instead of relying on lazy auto-install.","Check `npm config get registry` and proxy env vars in CI before running.","Verify Node.js and npm are installed and on PATH.","Watch disk space and permissions in the install directory."],"tags":["installation","npm","typescript","file-not-found"],"backgroundTag":"language-server-install-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}