Node Runtime
Node Runtime
Migration in progress.
api.legendary-arena.comand its PostgreSQL are moving off Render onto a self-hosted DigitalOcean Ubuntu droplet fronted by Cloudflare, perdocs/PLAN.md. Until decommission, Render stays warm as the rollback target.
Summary
This page provisions the Node.js toolchain the game server runs on. fnm
installs the pinned Node into a shared, world-readable directory, a stable /opt/node link points at it, and pnpm is installed alongside. The build and the systemd service both use /opt/node/bin directly, so nothing depends on a per-user fnm setup.
Mechanics
The owning artifact is infra/scripts/10-node.ps1
. It requires root, runs under Set-StrictMode, and stops on the first failing command (including native commands such as apt-get). In order:
Prereqs. Confirms the operator user exists, then installs
curl,ca-certificates, andunzip.fnm. Downloads
fnm-linux.zipfrom the latest fnm release into/opt/fnm/fnm. Skipped if the binary is already there.Node. Installs the pinned Node with
FNM_DIR=/opt/fnm/node-versionsand points/opt/nodeat the installation:NODE_VERSION = 24.18.0 /opt/fnm/node-versions/node-versions/v24.18.0/installation # the real install /opt/node -> that installation # what everything usesfnm’s default
FNM_DIRis the invoking user’s home. Run as root, that put Node under/root, where the operator-owned service could not reach it; the shared directory is the fix.pnpm.
npm install --global pnpm@10.32.1into/opt/node, so/opt/node/bin/pnpmexists for every user.Shell profile. Writes
/etc/profile.d/la-node.shso login shells put/opt/node/binonPATH.Verify. Prints
node --versionandpnpm --versionas the operator user, which proves the service account can run them.
The pinned 24.18.0 matches the engine repo’s .node-version and Render’s NODE_VERSION (D-24205); pnpm 10.32.1 matches the engine’s packageManager field.
Interactions
- Deploy Server
— builds with
/opt/node/bin/pnpm; run this page first. - Provision Droplet — cloud-init creates the operator user this script requires.
- The
la-serverunit runs/opt/node/bin/nodedirectly (see Deploy Server ).
Edge Cases
- Version must match
.node-version. Perdocs/PLAN.md(D-24205), a newer Node is a different system, not a compatible upgrade. To upgrade, changeNODE_VERSIONhere, in the engine repo’s.node-version, and inrender.yamltogether; re-running the script re-points/opt/node. /opt/nodeis load-bearing. The systemd unit and the deploy script use that path. Do not remove it while the service is running.- pnpm version follows
packageManager. ChangingPNPM_VERSIONwithout the engine’spackageManagerfield drifts the toolchain. - GitHub fetch at provision time. The fnm download uses GitHub’s release API; a network blip or rate limit fails the step. Re-run; it is idempotent.
Execute
# Default provision (operator user, Node 24.18.0, pnpm 10.32.1)
sudo pwsh -File /opt/la-lab/infra/scripts/10-node.ps1
Verify
sudo -u operator /opt/node/bin/node --version
# Expected: v24.18.0
sudo -u operator env PATH=/opt/node/bin:/usr/bin:/bin pnpm --version
# Expected: 10.32.1
The provision smoke workflow runs this script twice on a fresh Ubuntu 24.04 runner (install and idempotent re-run).
References
infra/scripts/10-node.ps1— the owning provisioning artifact.docs/PLAN.md— Node 24.18.0 / pnpm 10.32.1 pins and D-24205.content/runtime/node-runtime.md— original source content for this page.- Deploy Server
— consumes
/opt/node. - Provision Droplet — creates the operator user prerequisite.