Node

Install Node.js in Ubuntu-based containers.

Operations

Operation Description
Node.Install
Install Node.js globally in the container. Skips installation if already present (for warm containers). Calling this method disables automatic Node.js installation for subsequent npm operations. Note: Npm operations (Ci, Install, Run, Test, Build) automatically install Node.js if not present.

Operation Details

Node.Install source

Install Node.js globally in the container. Skips installation if already present (for warm containers). Calling this method disables automatic Node.js installation for subsequent npm operations. Note: Npm operations (Ci, Install, Run, Test, Build) automatically install Node.js if not present.

Node.Install(); // Installs Node.js v22 (current LTS)
Node.Install("20"); // Installs Node.js v20

Overview

The Node operations allow you to install Node.js globally in Ubuntu-based containers. This is useful when using the default ubuntu:22.04 image, which doesn’t include Node.js pre-installed.

For warm containers, the installation is skipped if Node.js is already installed at the correct major version, making subsequent builds fast.

Example

Build a static website with Node.js.

// Install Node.js (includes npm)
Node.Install();

// Install dependencies
Npm.Install();

// Build the site
Npm.Build();

Version Support

You can specify the Node.js major version to install:

// Install Node.js 20 (previous LTS)
Node.Install("20");

// Install Node.js 22 (current LTS, default)
Node.Install("22");

// Or use default (currently v22)
Node.Install();