Function Store
  • Home
  • Getting started
    • Introduction
    • Installing a function
    • Reconfiguring a function
    • Uninstalling a function
    • FAQs
  • Reference
    • Requirements
      • Assign Roles
        • User permissions
      • Link a Billing account to your project
      • Enable the APIs
    • Projects
      • How to add a project
      • How to set up a project
    • Functions
      • Benefits
      • Use cases
      • Authentication when installing
      • Runtime configuration
      • Deploying with a ZIP file
    • Policies
      • How to add a Policy
      • How to remove a Policy
    • Authentication
      • Users
      • Roles
      • Permissions
    • Secrets
      • Creating a Secret
      • Using a Secret
      • Changing the value for a Secret
      • Deactivating a Secret
  • developers
    • Overview
    • Getting Started
    • Set up
    • Workspaces
      • Create a workspace
      • Workspace boilerplate
      • Node engines
    • Writing Functions
      • Function Anatomy
      • Configuration file
      • Function Triggers
      • Environment Variables
        • Type "text"
        • Type "number"
        • Type "email"
        • Type "url"
        • Type "json"
        • Type "boolean"
        • Type "select"
        • Type "multiselect"
        • Type "firestoreDocumentPath"
        • Type "firestoreCollectionPath"
        • Type "color"
      • Documentation
    • Push/Update your functions in the cloud
    • Continuous Integration
    • Publish functions in the Marketplace
    • Emulators
      • Initialize emulators in your workspace
      • Environment variables
      • Starting emulators
      • Testing your functions in the emulator
      • Importing existing data into local emulators
        • Exporting data from Cloud Firestore to local emulator
        • Exporting user accounts from Firebase to local emulator
    • Visual Studio Code Extension
      • Installing the extension
      • Extension UI
      • Functions list
      • Creating and editing functions
      • Emulators
      • Extension settings
      • Troubleshooting
        • "Command not found" error when executing a command
  • Billing
    • Understanding Billing
  • Security
    • Security
  • Resources
    • Events and Triggers
    • Best Practices
      • How to log events in functions?
    • Document your Functions
    • Editorial guidelines
    • Our Processes
      • Use Cases Analysis
  • Use cases
    • Custom Stripe Checkout
Powered by GitBook
On this page
  • Cloud Functions supports the following Node.js runtimes:
  • Set a Node version:

Was this helpful?

  1. developers
  2. Workspaces

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.

PreviousWorkspace boilerplateNextWriting Functions

Last updated 3 years ago

Was this helpful?