{"record":{"id":"241b7150b0461986","repo":"sveltejs/kit","slug":"unsupported-node-js-version-process-version-p","errorCode":null,"errorMessage":"Unsupported Node.js version: ${process.version}. Please use Node ${formatter.format(valid_node_versions.map((v) => `${v}`))} to build your project, or explicitly specify a runtime in your adapter configuration.","messagePattern":"Unsupported Node\\.js version: (.+?)\\. Please use Node (.+?)`\\)\\)\\} to build your project, or explicitly specify a runtime in your adapter configuration\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-vercel/utils.js","lineNumber":94,"sourceCode":"function get_default_runtime() {\n\t// if the user ran e.g. `bunx --bun vite build`, infer that they want to run the app in Bun\n\tif (process.versions.bun) {\n\t\tconst major = process.versions.bun.split('.')[0];\n\t\tif (major !== '1') {\n\t\t\tthrow new Error(\n\t\t\t\t`Unsupported Bun version: ${major}. Please use Bun 1.x to build your project, or explicitly specify a runtime in your adapter configuration.`\n\t\t\t);\n\t\t}\n\n\t\treturn `bun${major}.x`;\n\t}\n\n\t// otherwise, default to the version of Node specified in the project config\n\tif (process.versions.node) {\n\t\tconst major = Number(process.versions.node.split('.')[0]);\n\n\t\tif (!valid_node_versions.includes(major)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unsupported Node.js version: ${process.version}. Please use Node ${formatter.format(valid_node_versions.map((v) => `${v}`))} to build your project, or explicitly specify a runtime in your adapter configuration.`\n\t\t\t);\n\t\t}\n\n\t\treturn `nodejs${/** @type {22 | 24} */ (major)}.x`;\n\t}\n\n\tthrow new Error(\n\t\t'Could not auto-detect a runtime. Please explicitly specify a runtime in your adapter configuration.'\n\t);\n}\n\nconst valid_runtimes = /** @type {const} */ (['nodejs22.x', 'nodejs24.x', 'bun1.x']);\n\n/**\n * @param {string} key\n * @returns {asserts key is RuntimeKey}\n */","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/adapter-vercel/utils.js#L76-L112","documentation":"With no explicit runtime configured, adapter-vercel defaults to the runtime matching the Node.js version used to build. Only a fixed set of major versions (currently 22 and 24) maps to supported Vercel Node runtimes; any other major throws listing the valid versions.","triggerScenarios":"Building with a Node major version not in `valid_node_versions` (e.g. Node 20, 23, or 25) while the adapter config omits `runtime` in utils.js get_default_runtime.","commonSituations":"Local machine or CI runner uses the system Node (e.g. Node 20 LTS) rather than a supported version; trying out a fresh Node release; Docker image with an unsupported Node tag.","solutions":["Build with a supported Node major version (22 or 24) — switch via nvm/volta: `nvm use 22`","Pin Node 22 or 24 in CI (actions/setup-node with node-version: 22)","Explicitly specify a runtime in the adapter config, e.g. `vercel({ runtime: 'nodejs22.x' })`, to bypass version inference","Update @sveltejs/adapter-vercel if a newer version supports your Node major"],"exampleFix":"// before (CI)\nnode-version: 20\n// after\nnode-version: 22\n// or in svelte.config.js\nexport default adapter({ runtime: 'nodejs20.x' }); // if supported by your adapter version; else build on Node 22","handlingStrategy":"fallback","validationCode":"const validNodeMajors = [22, 24];\nconst major = Number(process.versions.node.split('.')[0]);\nif (!validNodeMajors.includes(major)) {\n  console.warn(`Node ${major} not supported by adapter default runtime; pin Node ${validNodeMajors} or set runtime explicitly`);\n}","typeGuard":"const isSupportedNode = (majors = [22, 24]) =>\n  majors.includes(Number(process.versions.node.split('.')[0]));","tryCatchPattern":"try {\n  await build();\n} catch (err) {\n  if (err.message.includes('Unsupported Node.js version')) {\n    console.error('Build on a supported Node major (see message) or set runtime explicitly.');\n  }\n  throw err;\n}","preventionTips":["Pin Node 22/24 via nvm/volta and .nvmrc","Pin node-version in CI setup-node","Set explicit runtime in adapter config to decouple build env from deploy runtime","Re-check supported versions whenever upgrading adapter-vercel"],"tags":["vercel","node","versioning","build"],"backgroundTag":"unsupported-runtime-version","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}