calesthio/OpenMontage · error · SystemExit

Error: Node.js is required. Install it from https://nodejs.o

Error message

Error: Node.js is required. Install it from https://nodejs.org/

What it means

Raised by render_demo.py's ensure_demo_environment() as SystemExit when neither 'node' nor 'node.exe' is found on PATH via shutil.which. The demo renderer drives Remotion through npx, which requires a Node.js runtime; this is a preflight check that fails before any npm install or render subprocess is spawned, giving an actionable message instead of a cryptic spawn error.

Source

Thrown at render_demo.py:51


def discover_demos() -> dict[str, Path]:
    if not PROPS_DIR.exists():
        return {}
    return {path.stem: path for path in sorted(PROPS_DIR.glob("*.json"))}


def find_command(*names: str) -> str | None:
    for name in names:
        resolved = shutil.which(name)
        if resolved:
            return resolved
    return None


def ensure_demo_environment() -> str:
    if not find_command("node", "node.exe"):
        raise SystemExit("Error: Node.js is required. Install it from https://nodejs.org/")

    npm_cmd = find_command("npm.cmd", "npm", "npm.exe")
    if not npm_cmd:
        raise SystemExit("Error: npm is required but was not found on PATH.")

    npx_cmd = find_command("npx.cmd", "npx", "npx.exe")
    if not npx_cmd:
        raise SystemExit("Error: npx is required but was not found on PATH.")

    if not (COMPOSER_DIR / "node_modules").exists():
        print("Installing Remotion dependencies...")
        subprocess.run([npm_cmd, "install"], cwd=COMPOSER_DIR, check=True)

    return npx_cmd


def validate_props_file(path: Path) -> None:
    with path.open("r", encoding="utf-8") as handle:

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Install Node.js (LTS) from https://nodejs.org/ or via your package manager, then reopen the terminal so PATH updates.
  2. If you use nvm/fnm/volta, run its activation command (e.g. nvm use --lts) in the same shell before rerunning.
  3. In CI, add a Node setup step (e.g. actions/setup-node) before invoking render_demo.py.

Example fix

# shell — before
python render_demo.py  # SystemExit: Node.js is required

# shell — after
# macOS/Linux
brew install node@lts || nvm install --lts && nvm use --lts
python render_demo.py
Defensive patterns

Strategy: validation

Validate before calling

import shutil

if not shutil.which("node"):
    raise SystemExit("Node.js is required. Install it from https://nodejs.org/ and reopen your terminal.")

Type guard

import shutil

def node_available() -> bool:
    return shutil.which("node") is not None or shutil.which("node.exe") is not None

Try / catch

try:
    npx = ensure_demo_environment()
except SystemExit as e:
    print(f"Environment not ready: {e}")
    return 1

Prevention

When it happens

Trigger: Running render_demo.py on a machine without Node.js installed; Node installed via a version manager (nvm/fnm) but the shell session hasn't activated it; PATH mangled inside an IDE/CI launcher so the node binary directory isn't included.

Common situations: Fresh machine or container without Node; CI image missing the Node setup step; nvm installed but the current shell didn't source it; Windows where node.exe is on PATH but named differently or missing entirely.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/39ee3ac95d95d989. Report an issue: GitHub.