Node engines

Define the Node engine for a workspace.

Cloud Functions run in a fully-managed, serverless environment where Google handles infrastructure, operating systems, and runtime environments. Each Cloud Function runs in its own isolated secure execution context, scales automatically, and has a lifecycle independent from other functions.

By default, all functions are deployed to GCP to run in Node.js 16.

Cloud Functions supports the following Node.js runtimes:

  • Node.js 16 (recommended)

  • Node.js 14

  • Node.js 12

  • Node.js 10

In the workspace, you can change the version of Node, although most of the time, you won't need to change this.

Set a Node version:

When some dependency or any particular code you write for the function requires a specific Node version to run, you can set the Node version.

Set that version in the engines field that appears in the workspace package.json file. Note that this will affect all functions of the workspace.

For example, to use only version 14, add this line in the package.json:

  "engines": {"node": "14"}

This will make all functions of this workspace run on Node.js 14. Also, the platform's Continuous Integration workflow will run using this Node version.

Last updated