toolbox · runtime

Node.js

The JavaScript runtime that builds every site in this repo.

Install

winget install --id OpenJS.NodeJS.LTS --source winget
node --version
npm --version

What it is

Node.js runs JavaScript outside the browser. It is the engine behind our build scripts, the games site tooling and Astro.

How it works

  • It pairs the V8 JavaScript engine with an event loop and non-blocking I/O, so one process can handle many small file and network operations.
  • npm comes with it. package.json declares a project, package-lock.json pins exact versions, and node_modules/ holds what was installed.
  • Code can be CommonJS (require) or ESM (import). The root project is CommonJS; the research site is "type": "module".

In this project

  • shared/build.js and scripts/* are plain Node with no dependencies.
  • The games site’s generators and tests run on Node.
  • sites/research uses Astro 7, which requires Node 22.23 or newer.

Gotchas

  • node_modules/ is never committed. Run npm ci where a package-lock.json exists.
  • Cloudflare Pages needs a recent Node. The research project sets NODE_VERSION=24.
  • We build with the installed Node, not a bundled one: check node --version when something behaves differently.