Node Operations

Install Node.js in Ubuntu-based containers.

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.

Operations

Operation Description
Node.Install
Install Node.js globally in the container. Skips installation if already present (for warm containers).
Node.Install(); // Installs Node.js v22 (current LTS)
Node.Install("20"); // Installs Node.js v20

Example

Build a static website with Node.js.

build.ando
// 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:

build.ando
// 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();