{"record":{"id":"0a8baf7255f5041c","repo":"oraios/serena","slug":"vscode-json-languageserver-executable-not-found-at","errorCode":null,"errorMessage":"vscode-json-languageserver executable not found at {json_executable_path}, something went wrong with the installation.","messagePattern":"vscode-json-languageserver executable not found at (.+?), something went wrong with the installation\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/json_language_server.py","lineNumber":92,"sourceCode":"\n            # legacy unversioned dir reserved for INITIAL; every other version goes into a versioned subdir\n            ls_dirname = (\n                \"json-lsp\"\n                if json_language_server_version == INITIAL_JSON_LANGUAGE_SERVER_VERSION\n                else f\"json-lsp-{json_language_server_version}\"\n            )\n            json_ls_dir = os.path.join(self._ls_resources_dir, ls_dirname)\n            json_executable_path = os.path.join(json_ls_dir, \"node_modules\", \".bin\", \"vscode-json-languageserver\")\n\n            if os.name == \"nt\":\n                json_executable_path += \".cmd\"\n\n            if not os.path.exists(json_executable_path):\n                log.info(f\"JSON Language Server executable not found at {json_executable_path}. Installing...\")\n                deps.install(json_ls_dir)\n                log.info(\"JSON language server dependencies installed successfully\")\n\n            if not os.path.exists(json_executable_path):\n                raise FileNotFoundError(\n                    f\"vscode-json-languageserver executable not found at {json_executable_path}, something went wrong with the installation.\"\n                )\n\n            return json_executable_path\n\n        def _create_launch_command(self, core_path: str) -> list[str]:\n            return [core_path, \"--stdio\"]\n\n    def _create_base_initialize_params(self) -> dict:\n        \"\"\"\n        Returns the initialize params for the JSON Language Server.\n        \"\"\"\n        initialize_params = {\n            \"locale\": \"en\",\n            \"capabilities\": {\n                \"textDocument\": {\n                    \"synchronization\": {\"didSave\": True, \"dynamicRegistration\": True},","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/json_language_server.py#L74-L110","documentation":"The JSON language server is installed via npm (vscode-json-languageserver) into json_ls_dir, but after running deps.install the expected executable still cannot be found, so _get_or_install_core_dependency raises FileNotFoundError indicating the installation did not produce the expected artifact.","triggerScenarios":"_get_or_install_core_dependency: json_executable_path does not exist, deps.install(json_ls_dir) runs npm install, but a second os.path.exists(json_executable_path) still fails, raising the error.","commonSituations":"npm not installed or failing (network/registry errors swallowed); npm installed to a different global/node_modules layout so the binary path differs (e.g. node_modules/.bin/vscode-json-languageserver missing); Node version incompatibility with the package; antivirus or permissions blocking binary creation.","solutions":["Run the install manually inside json_ls_dir (`npm install`) and check npm's stderr for real errors.","Verify the actual executable location (e.g. json_ls_dir/node_modules/.bin/vscode-json-languageserver) and correct json_executable_path resolution if the package layout changed.","Ensure node/npm are installed and on PATH, then delete json_ls_dir and let Serena reinstall fresh.","Check disk space and directory write permissions for json_ls_dir."],"exampleFix":"// before (npm not on PATH, silent failure)\n# serena start --language json\n// FileNotFoundError: vscode-json-languageserver executable not found...\n// after\n$ which npm && npm -v\n$ cd <json_ls_dir> && npm install\n$ ls node_modules/.bin/vscode-json-languageserver","handlingStrategy":"validation","validationCode":"import shutil, os\ndef validate_json_ls_installable(json_ls_dir: str, executable_path: str) -> bool:\n    if shutil.which(\"npm\") is None:\n        return False\n    if not os.access(json_ls_dir, os.W_OK):\n        return False\n    return True  # then run `npm install` in json_ls_dir and check node_modules/.bin/vscode-json-languageserver","typeGuard":null,"tryCatchPattern":"try:\n    json_path = get_or_install_core_dependency()\nexcept FileNotFoundError as e:\n    if \"vscode-json-languageserver\" in str(e):\n        subprocess.run([\"npm\", \"install\"], cwd=json_ls_dir, check=True)  # surface npm's real error\n        bin_path = os.path.join(json_ls_dir, \"node_modules\", \".bin\", \"vscode-json-languageserver\")\n        if not os.path.exists(bin_path):\n            raise RuntimeError(\"npm install produced no vscode-json-languageserver binary\") from e\n    else:\n        raise","preventionTips":["Verify node/npm are installed and on PATH before initializing the JSON language server.","Run `npm install` manually in json_ls_dir once to surface registry/network errors the installer may hide.","Check the installed package layout; adjust executable path resolution when node_modules/.bin layout differs.","Monitor disk space and directory permissions in the Serena cache/install directory."],"tags":["json","npm","missing-binary","installation","file-not-found"],"backgroundTag":"language-server-not-installed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}