[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live) [Help](/c/help/9) # "Function Runtimes must have a valid version" Error Despite V2 Config 3680 views · 4 likes · 4 posts Jayco01 (@jayco01) · 2025-05-23 Hello Vercel Community, I'm consistently getting the error `Error: Function Runtimes must have a valid version, for example \`now-php@1.0.0\`.` despite my `vercel.json` being configured with `version: 2` and a valid Node.js runtime (e.g., `nodejs18.x`). **Issue:** My local `vercel -d` logs consistently show that when a deployment is created, Vercel's API responds with `"config":{"version":1}` in the deployment details, even though my `vercel.json` clearly specifies `"version": 2` causing the runtime definition to be rejected. **What I've Tried (All Resulted in the Same Error):** 1. **Original Project (`frontend-quiz-app-main`):** * `vercel.json`: ```json { "version": 2, "functions": { "api/**/*.js": { "runtime": "nodejs18.x" } } } ``` *(This project's `vercel.json` was also tested with `nodejs20.x` with the same error results).* * `api/gemini-chat.js`: ```javascript export const config = { runtime: 'nodejs18' }; ``` *(This function is for a Gemini chatbot API).* * Vercel Dashboard Node.js Version (Build Environment): Set to `18.x` (also tried `20.x` when `vercel.json` was `nodejs20.x`). * Failed Deployment Inspect URL: `https://vercel.com/jay-laycos-projects/frontend-quiz-app-main/Cyo25teCvZdW7kS7j3mn3VYyEa9d?filter=errors` * (Project ID: `prj_ws12Su6Z5bCQCmIC7AVrT8rRhLnF`, Team: `Jay Layco's projects` - `team_K4IsiEAa1G2LBBRbqwgM4iiW`) 2. **New Minimal Test Project (`gemini-api-test`):** Created to isolate the issue with identical settings and simplified code. * `vercel.json` and `api/gemini-chat.js` configured as above for `nodejs18.x`. * `package.json`: `{"dependencies": { "@google/generative-ai": "^0.14.1" }}` * Vercel Dashboard Node.js Version (Build Environment): Set to `18.x`. * **Outcome:** Same error, and local CLI logs again showed Vercel's API responding with `"config":{"version":1}`. * Failed Deployment Inspect URL: `https://vercel.com/jay-laycos-projects/gemini-api-test/8ywS9NVLuuEx12UhpweXZAoaJPMq?filter=errors` * (Project ID: `prj_2vGhatZNfW689tmCtEkbX8gvYL3F`) It seems like my projects are being forced into a V1 configuration context by Vercel's backend, making valid V2 runtime definitions fail. Has anyone encountered this behavior where `version: 2` in `vercel.json` isn't fully respected, leading to this runtime error? Any suggestions would be highly appreciated. Thank you! Anshuman Bhardwaj (@anshumanb) · 2025-05-23 · ♥ 2 Hi @jayco01, welcome to the Vercel Community! Sorry that you're facing this issue. I'd suggest removing the Node.js version declaration from all the places (including `vercel.json`) and then using the `engines` field in the `package.json` to set the Node version. For more information, see [version override docs](https://vercel.com/docs/functions/runtimes/node-js/node-js-versions#version-overrides-in-package.json). Also, using a new version of Node will be better because 18.x will reach end of life on Vercel on 1 August 2025. For more information, refer to https://vercel.com/docs/functions/runtimes/node-js/node-js-versions#default-and-available-versions. Jayco01 (@jayco01) · 2025-05-23 · ♥ 2 Thank You! This fixed the issue. Pauline P. Narvas (@pawlean) · 2026-02-25 Flagging a time-sensitive update relevant to this thread — Vercel has announced that support for `now.json` will be **removed on March 31, 2026**. The version detection issues described here are often caused by legacy `now.json` config being picked up alongside or instead of `vercel.json`. The migration is a single step: **rename `now.json` to `vercel.json`** — no content changes needed. If you're still seeing `"config":{"version":1}` responses despite specifying v2, checking for a stale `now.json` in your repo is a good first step. Reference: https://vercel.com/changelog/support-for-now-json-will-be-removed-on-march-31-2026