{"record":{"id":"7f498c7880ed2283","repo":"oraios/serena","slug":"node-js-is-not-installed-or-isn-t-in-path-please","errorCode":null,"errorMessage":"Node.js is not installed or isn't in PATH. Please install Node.js and try again.","messagePattern":"Node\\.js is not installed or isn't in PATH\\. Please install Node\\.js and try again\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/matlab_language_server.py","lineNumber":332,"sourceCode":"            matlab_path = self._custom_settings.get(\"matlab_path\")\n\n            if not matlab_path:\n                matlab_path = self._find_matlab_installation()  # Raises RuntimeError if not found\n\n            # Verify MATLAB path exists\n            if not os.path.isdir(matlab_path):\n                raise RuntimeError(f\"MATLAB installation directory does not exist: {matlab_path}\")\n\n            log.info(f\"Using MATLAB installation: {matlab_path}\")\n\n            self._matlab_path = matlab_path\n            return matlab_path\n\n        def create_launch_command(self) -> list[str]:\n            # Verify node is installed\n            node_path = shutil.which(\"node\")\n            if node_path is None:\n                raise RuntimeError(\"Node.js is not installed or isn't in PATH. Please install Node.js and try again.\")\n\n            # Find existing extension or download if needed\n            extension_path = self._find_matlab_extension()\n            if extension_path is None:\n                log.info(\"MATLAB extension not found on disk, attempting to download...\")\n                extension_path = self._download_and_install_matlab_extension()\n\n            if extension_path is None:\n                raise RuntimeError(\n                    \"Failed to locate or download MATLAB Language Server. Please either:\\n\"\n                    \"1. Set MATLAB_EXTENSION_PATH environment variable to the MATLAB extension directory\\n\"\n                    \"2. Install the MATLAB extension in VS Code (MathWorks.language-matlab)\\n\"\n                    \"3. Ensure internet connection for automatic download\"\n                )\n\n            # Get the language server script path\n            server_script = self._get_executable_path(extension_path)\n","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/matlab_language_server.py#L314-L350","documentation":"The MATLAB language server is a Node.js script, so create_launch_command first resolves `node` via shutil.which. If Node.js is not on PATH, the server cannot be launched at all and RuntimeError is raised with install guidance.","triggerScenarios":"create_launch_command is called (during MATLAB language server startup) on a machine where `node` is not installed or is not on the PATH of the process running the library — common in systemd services, Docker containers, or IDE-spawned processes with a stripped PATH.","commonSituations":"Fresh CI runners without Node; nvm-managed Node not loaded in non-interactive shells; running inside Docker with a slim base image; launching from a GUI app whose PATH differs from your shell.","solutions":["Install Node.js (apt install nodejs, brew install node, or the official installer)","Ensure the node binary's directory is on PATH for the process running the library (e.g. source nvm in the launch script, or set PATH in the service unit/Dockerfile)","Verify with `which node` / shutil.which(\"node\") in the same environment that runs the server"],"exampleFix":"# before (service file)\nExecStart=/opt/myapp/server\n# after\nEnvironment=\"PATH=/usr/local/bin:/usr/bin:%p/bin\"\nExecStart=/opt/myapp/server   # node now resolvable","handlingStrategy":"validation","validationCode":"import shutil\nif shutil.which(\"node\") is None:\n    raise RuntimeError(\"Node.js must be installed and on PATH before starting the MATLAB language server\")","typeGuard":"def node_available() -> bool:\n    return shutil.which(\"node\") is not None","tryCatchPattern":"try:\n    ls = SolidLSP(\"matlab\")\nexcept RuntimeError as e:\n    if \"Node.js is not installed\" in str(e):\n        ensure_node_on_path()  # install node / extend PATH\n        ls = SolidLSP(\"matlab\")\n    else:\n        raise","preventionTips":["Add node to PATH in service units, Dockerfiles, and CI images","For nvm, source nvm.sh in non-interactive launch scripts","Smoke-test shutil.which(\"node\") in the exact environment that runs the app"],"tags":["matlab","nodejs","environment","path"],"backgroundTag":"missing-runtime-dependency","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}