{"record":{"id":"aea6aac08387e876","repo":"langchain-ai/langgraph","slug":"node-js-version-must-be-major-version-only","errorCode":null,"errorMessage":"Node.js version must be major version only","messagePattern":"Node\\.js version must be major version only","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/cli/langgraph_cli/config.py","lineNumber":149,"sourceCode":"                \"RUN rm /usr/bin/uv /usr/bin/uvx\\n# -- End of build deps removal --\"\n            )\n    return \"\\n\".join(commands)\n\n\ndef _parse_version(version_str: str) -> tuple[int, int]:\n    \"\"\"Parse a version string into a tuple of (major, minor).\"\"\"\n    try:\n        major, minor = map(int, version_str.split(\"-\")[0].split(\".\"))\n        return (major, minor)\n    except ValueError:\n        raise click.UsageError(f\"Invalid version format: {version_str}\") from None\n\n\ndef _parse_node_version(version_str: str) -> int:\n    \"\"\"Parse a Node.js version string into a major version number.\"\"\"\n    try:\n        if \".\" in version_str:\n            raise ValueError(\"Node.js version must be major version only\")\n        return int(version_str)\n    except ValueError:\n        raise click.UsageError(\n            f\"Invalid Node.js version format: {version_str}. \"\n            \"Use major version only (e.g., '20').\"\n        ) from None\n\n\ndef _parse_api_version_parts(version_str: str) -> tuple[int, ...]:\n    \"\"\"Parse an API version into numeric components.\n\n    Supports optional prerelease suffixes, e.g. `0.9.0rc1`.\n    \"\"\"\n    version_core = version_str.split(\"-\", 1)[0]\n    match = _API_VERSION_PATTERN.fullmatch(version_core)\n    if not match:\n        raise ValueError(\"Version must be major or major.minor or major.minor.patch.\")\n    return tuple(int(part) for part in match.groups() if part is not None)","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/cli/langgraph_cli/config.py#L131-L167","documentation":"Format validation in the CLI's _parse_node_version helper: the node_version config value must be a bare major version (e.g. '20'), because only major Node.js versions are supported in generated Dockerfiles. The parser calls int() on the whole string; values like '20.11', 'v20', or '20.x' fail conversion and hit this UsageError.","triggerScenarios":"Thrown at libs/cli/langgraph_cli/config.py:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set node_version to a major version integer string, e.g. \"node_version\": \"20\"","Remove prefixes ('v') and minor/patch suffixes from the value in langgraph.json"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}