Firexport logo

FirexportBlog

Node.js 20 is decommissioned on Cloud Functions for Firebase: move to 24 or 22

On October 30, 2026, the Node.js 20 runtime for Cloud Functions was decommissioned. You can no longer deploy or update functions on Node.js 20, so firebase deploy stops with the error below. The fix is one line in functions/package.json. Move to Node.js 24 if all your functions are 2nd gen, or to Node.js 22 if you have 1st gen functions.

Error: Runtime Node.js 20 was decommissioned on 2026-10-30. To deploy you must
first upgrade your runtime version.

In short

  • It’s not only deploys. Functions you already deployed still run, but they get no security patches and may be disabled, with no date set. Dates and what they mean
  • Change one line and redeploy. Set engines.node to "24" or "22". If firebase.json has a runtime, that one wins. How
  • 24 for 2nd gen, 22 for 1st gen. Node.js 22 is the last runtime for 1st gen functions, so they have to move to 2nd gen before 22 ends on October 31, 2027. 1st gen functions
  • If you upgrade the SDKs, check two things. firebase-functions 7 removed functions.config(), and firebase-admin 14 runs only on Node.js 22 or later. SDK versions

Dates and what they mean

This is Google Cloud’s runtime support schedule. During deprecation you can still deploy; after decommission you can neither create nor update functions on the runtime.

RuntimeAvailable toDeprecationDecommission
Node.js 181st gen, 2nd gen2025-04-302025-10-30
Node.js 201st gen, 2nd gen2026-04-302026-10-30
Node.js 221st gen, 2nd gen2027-04-302027-10-31
Node.js 242nd gen only2028-04-302028-10-31

What changes at decommission:

During deprecationAfter decommission
Deploy or updateYesNo
Functions already deployedRunRun, but may be disabled
Node.js and OS security patchesYesNone

The policy gives no date for disabling. A function that runs fine today can’t be redeployed the moment you need to fix a bug, and you can’t tell when it might stop. There’s no way around it either: turn off the CLI’s runtime check and the server still refuses (CLI source).

Moving to Node.js 24 or 22

  1. Check each function’s generation and runtime. Run firebase functions:list. In the Version column, v1 is 1st gen and v2 is 2nd gen; the Runtime column is the current runtime.
  2. Pick a version. The runtime is set per codebase (usually the functions folder), not per function. If any function in it is 1st gen, pick 22; if all are 2nd gen, pick 24. Node.js 24 lasts until October 31, 2028, but 1st gen doesn’t support it. Firebase’s docs don’t list 24 yet, but Cloud’s schedule has it for 2nd gen and the Firebase CLI supports it from 14.26.0.
  3. Change one line in package.json. The value is a single major version. A range such as >=22 or 22.x makes the CLI fail with Detected node engine ... which is not a supported version.
    {
      "engines": {
        "node": "24"
      }
    }

    If firebase.json has a runtime, the CLI uses that value first, so change it there instead.

    {
      "functions": {
        "source": "functions",
        "runtime": "nodejs24"
      }
    }
  4. Use the same Node.js locally and in CI. The emulator runs your functions on the Node.js you have installed. If the versions differ, it only warns, Your requested "node" version "24" doesn't match your global version "20", and runs them on 20, so your tests run on a different version than production.
  5. Deploy. Run firebase deploy --only functions, then check that the Runtime column of firebase functions:list says nodejs24 (or nodejs22).

SDK versions

If you upgrade the SDKs along with Node.js, check these.

PackageWhat to check
firebase-tools (CLI)Deploys nodejs22 from 13.11.0 and nodejs24 from 14.26.0.
firebase-functionsBelow 6.2.0, ESM code with a top-level await breaks on Node.js 22.12 and later. 7.0.0 removed functions.config(): calling it throws at runtime.
firebase-admin14 runs only on Node.js 22 or later and needs firebase-functions 7.3.0 or later (peer dependency). 13 runs on Node.js 18 or later.

If you still use functions.config(), keep firebase-functions on 6.x and change only Node.js. Deploys that use functions.config() fail after March 2027 too, so move to environment variables or Secret Manager before then.

1st gen functions

Node.js 22 is the last runtime 1st gen functions can use, and it is decommissioned on October 31, 2027. They have to move to 2nd gen before then. Firebase CLI 15.35.0’s warnings give 22’s decommission date as 2028-10-31, but Google Cloud’s schedule, 2027-10-31, is the one that counts (CLI source). You can’t switch a function in place under the same name, so Firebase tells you to deploy the 2nd gen function under a new name, move traffic to it, then delete the 1st gen one (upgrade guide). What to watch for:

  • URLs change. For HTTP, callable and task queue functions, a new name is a new URL. Move your apps and webhooks to it, then delete the old function with firebase functions:delete.
  • Events are handled twice. While both exist, event triggers such as Firestore and Storage run both functions for the same event. Make sure running twice gives the same result.
  • Some things are missing. 2nd gen has no functions.config() and no Analytics event triggers, and the Authentication user created and deleted triggers (onUserCreated, onUserDeleted) are still in Preview.
  • Defaults differ. One instance handles up to 80 requests at once by default, and the default service account becomes the Compute Engine default service account. If you keep per-request values in global variables, or granted IAM permissions to the App Engine default service account, fix that.

Extensions

Installed extensions run on Cloud Functions too, and the extension’s version sets their runtime. Firebase tells you to keep each extension updated to its latest version.

firebase ext:update <instance-id>
firebase deploy --only extensions

The Firebase Extensions service shuts down on March 31, 2027. Installed extensions keep running after that, but management features such as updates go away. Most are built on 1st gen functions, so they may stop or be disabled once their runtime is decommissioned. If you depend on one, plan to replace it with your own function.

Sources

All posts →