{"record":{"id":"23a0133f363feed7","repo":"HKUDS/DeepTutor","slug":"node-js-20-is-required-to-run-the-source-producti","errorCode":null,"errorMessage":"Node.js 20+ is required to run the source production build.","messagePattern":"Node\\.js 20\\+ is required to run the source production build\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"deeptutor/runtime/launcher.py","lineNumber":759,"sourceCode":"        runtime_web = _copy_packaged_web_if_needed(\n            packaged,\n            home=home,\n            api_base=api_base,\n            auth_enabled=auth_enabled,\n        )\n        return FrontendRuntime(\"packaged\", [node, str(runtime_web / \"server.js\")], runtime_web)\n\n    source = _source_web_dir(home)\n    if source is not None:\n        npm = shutil.which(\"npm\")\n        if not npm:\n            raise SystemExit(\n                \"npm not found. Source installs require Node.js/npm and `cd web && npm install`.\"\n            )\n        _ensure_web_dependencies(source, npm)\n        if not dev:\n            if not node:\n                raise SystemExit(\"Node.js 20+ is required to run the source production build.\")\n            _ensure_source_production_build(\n                source,\n                npm,\n                api_base=api_base,\n                auth_enabled=auth_enabled,\n            )\n            standalone = source / SOURCE_PRODUCTION_DIST_DIR / \"standalone\"\n            return FrontendRuntime(\n                \"source-production\",\n                [node, str(standalone / \"server.js\")],\n                standalone,\n            )\n        return FrontendRuntime(\n            \"source\", [npm, \"run\", \"dev\", \"--\", \"--port\", str(frontend_port)], source\n        )\n\n    raise SystemExit(\n        \"DeepTutor Web assets are not installed. Install the full app with `pip install -U deeptutor`, \"","sourceCodeStart":741,"sourceCodeEnd":777,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/runtime/launcher.py#L741-L777","documentation":"Raised by _resolve_frontend in deeptutor/runtime/launcher.py when running a source install (web/ checkout present) in production (non-dev) mode but no Node.js executable was found on PATH. The launcher needs Node 20+ to build the frontend production bundle via npm.","triggerScenarios":"Calling deeptutor start (or launcher.start()) from a source checkout without dev=True on a machine where `node` is not on PATH or is not version 20+.","commonSituations":"Running from a git clone in a minimal container/venv where Node was never installed; Node installed via nvm but the shell launching deeptutor doesn't source nvm; CI images without Node.","solutions":["Install Node.js 20+ (e.g. via nvm: `nvm install 20 && nvm use 20`) and ensure `node` is on PATH before running deeptutor","Run in dev mode: `deeptutor start --dev` (or start(dev=True)) which skips the production build","Install the full packaged app instead: `pip install -U deeptutor` which ships prebuilt web assets and needs no Node"],"exampleFix":"# before\ndeeptutor start   # from source checkout, no node on PATH\n# after\nnvm use 20 && deeptutor start\n# or\ndeeptutor start --dev","handlingStrategy":"validation","validationCode":"import shutil\nnode = shutil.which(\"node\")\nif not node:\n    raise SystemExit(\"Install Node.js 20+ first\")\nimport subprocess\nv = subprocess.run([node, \"--version\"], capture_output=True, text=True).stdout\nmajor = int(v.strip().lstrip(\"v\").split(\".\")[0])\nassert major >= 20, f\"Node 20+ required, got {v}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-check shutil.which('node') and the major version before calling start() from a source checkout","Install Node via nvm and ensure the launching shell sources nvm","In Dockerfiles for source installs, add a Node 20+ layer or prebuild the web assets"],"tags":["nodejs","launcher","frontend","missing-dependency","source-install"],"backgroundTag":"missing-runtime-dependency","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}