mirror of https://github.com/openclaw/openclaw.git
build: default to Node 24 and keep Node 22 compat
This commit is contained in:
parent
2f037f0930
commit
deada7edd3
|
|
@ -1,12 +1,16 @@
|
|||
name: Setup Node environment
|
||||
description: >
|
||||
Initialize submodules with retry, install Node 22, pnpm, optionally Bun,
|
||||
Initialize submodules with retry, install Node 24 by default, pnpm, optionally Bun,
|
||||
and optionally run pnpm install. Requires actions/checkout to run first.
|
||||
inputs:
|
||||
node-version:
|
||||
description: Node.js version to install.
|
||||
required: false
|
||||
default: "22.x"
|
||||
default: "24.x"
|
||||
cache-key-suffix:
|
||||
description: Suffix appended to the pnpm store cache key.
|
||||
required: false
|
||||
default: "node24"
|
||||
pnpm-version:
|
||||
description: pnpm version for corepack.
|
||||
required: false
|
||||
|
|
@ -54,7 +58,7 @@ runs:
|
|||
uses: ./.github/actions/setup-pnpm-store-cache
|
||||
with:
|
||||
pnpm-version: ${{ inputs.pnpm-version }}
|
||||
cache-key-suffix: "node22"
|
||||
cache-key-suffix: ${{ inputs.cache-key-suffix }}
|
||||
use-sticky-disk: ${{ inputs.use-sticky-disk }}
|
||||
|
||||
- name: Setup Bun
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ inputs:
|
|||
cache-key-suffix:
|
||||
description: Suffix appended to the cache key.
|
||||
required: false
|
||||
default: "node22"
|
||||
default: "node24"
|
||||
use-sticky-disk:
|
||||
description: Use Blacksmith sticky disks instead of actions/cache for pnpm store.
|
||||
required: false
|
||||
|
|
|
|||
|
|
@ -233,6 +233,34 @@ jobs:
|
|||
- name: Check docs
|
||||
run: pnpm check:docs
|
||||
|
||||
compat-node22:
|
||||
name: "compat-node22"
|
||||
needs: [docs-scope, changed-scope]
|
||||
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
|
||||
runs-on: blacksmith-16vcpu-ubuntu-2404
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
- name: Setup Node 22 compatibility environment
|
||||
uses: ./.github/actions/setup-node-env
|
||||
with:
|
||||
node-version: "22.x"
|
||||
cache-key-suffix: "node22"
|
||||
install-bun: "false"
|
||||
use-sticky-disk: "true"
|
||||
|
||||
- name: Configure Node 22 test resources
|
||||
run: |
|
||||
# Keep the compatibility lane aligned with the default Node test lane.
|
||||
echo "OPENCLAW_TEST_WORKERS=2" >> "$GITHUB_ENV"
|
||||
echo "OPENCLAW_TEST_MAX_OLD_SPACE_SIZE_MB=6144" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Run Node 22 compatibility gate
|
||||
run: pnpm build && pnpm test
|
||||
|
||||
skills-python:
|
||||
needs: [docs-scope, changed-scope]
|
||||
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true' || needs.changed-scope.outputs.run_skills_python == 'true')
|
||||
|
|
@ -401,14 +429,14 @@ jobs:
|
|||
- name: Setup Node.js
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: 22.x
|
||||
node-version: 24.x
|
||||
check-latest: false
|
||||
|
||||
- name: Setup pnpm + cache store
|
||||
uses: ./.github/actions/setup-pnpm-store-cache
|
||||
with:
|
||||
pnpm-version: "10.23.0"
|
||||
cache-key-suffix: "node22"
|
||||
cache-key-suffix: "node24"
|
||||
# Sticky disk mount currently retries/fails on every shard and adds ~50s
|
||||
# before install while still yielding zero pnpm store reuse.
|
||||
# Try exact-key actions/cache restores instead to recover store reuse
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ concurrency:
|
|||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
NODE_VERSION: "22.x"
|
||||
NODE_VERSION: "24.x"
|
||||
PNPM_VERSION: "10.23.0"
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
16
Dockerfile
16
Dockerfile
|
|
@ -14,14 +14,14 @@
|
|||
# Slim (bookworm-slim): docker build --build-arg OPENCLAW_VARIANT=slim .
|
||||
ARG OPENCLAW_EXTENSIONS=""
|
||||
ARG OPENCLAW_VARIANT=default
|
||||
ARG OPENCLAW_NODE_BOOKWORM_IMAGE="node:22-bookworm@sha256:b501c082306a4f528bc4038cbf2fbb58095d583d0419a259b2114b5ac53d12e9"
|
||||
ARG OPENCLAW_NODE_BOOKWORM_DIGEST="sha256:b501c082306a4f528bc4038cbf2fbb58095d583d0419a259b2114b5ac53d12e9"
|
||||
ARG OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE="node:22-bookworm-slim@sha256:9c2c405e3ff9b9afb2873232d24bb06367d649aa3e6259cbe314da59578e81e9"
|
||||
ARG OPENCLAW_NODE_BOOKWORM_SLIM_DIGEST="sha256:9c2c405e3ff9b9afb2873232d24bb06367d649aa3e6259cbe314da59578e81e9"
|
||||
ARG OPENCLAW_NODE_BOOKWORM_IMAGE="node:24-bookworm@sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b"
|
||||
ARG OPENCLAW_NODE_BOOKWORM_DIGEST="sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b"
|
||||
ARG OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE="node:24-bookworm-slim@sha256:e8e2e91b1378f83c5b2dd15f0247f34110e2fe895f6ca7719dbb780f929368eb"
|
||||
ARG OPENCLAW_NODE_BOOKWORM_SLIM_DIGEST="sha256:e8e2e91b1378f83c5b2dd15f0247f34110e2fe895f6ca7719dbb780f929368eb"
|
||||
|
||||
# Base images are pinned to SHA256 digests for reproducible builds.
|
||||
# Trade-off: digests must be updated manually when upstream tags move.
|
||||
# To update, run: docker manifest inspect node:22-bookworm (or podman)
|
||||
# To update, run: docker buildx imagetools inspect node:24-bookworm (or podman)
|
||||
# and replace the digest below with the current multi-arch manifest list entry.
|
||||
|
||||
FROM ${OPENCLAW_NODE_BOOKWORM_IMAGE} AS ext-deps
|
||||
|
|
@ -92,12 +92,12 @@ RUN CI=true pnpm prune --prod && \
|
|||
# ── Runtime base images ─────────────────────────────────────────
|
||||
FROM ${OPENCLAW_NODE_BOOKWORM_IMAGE} AS base-default
|
||||
ARG OPENCLAW_NODE_BOOKWORM_DIGEST
|
||||
LABEL org.opencontainers.image.base.name="docker.io/library/node:22-bookworm" \
|
||||
LABEL org.opencontainers.image.base.name="docker.io/library/node:24-bookworm" \
|
||||
org.opencontainers.image.base.digest="${OPENCLAW_NODE_BOOKWORM_DIGEST}"
|
||||
|
||||
FROM ${OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE} AS base-slim
|
||||
ARG OPENCLAW_NODE_BOOKWORM_SLIM_DIGEST
|
||||
LABEL org.opencontainers.image.base.name="docker.io/library/node:22-bookworm-slim" \
|
||||
LABEL org.opencontainers.image.base.name="docker.io/library/node:24-bookworm-slim" \
|
||||
org.opencontainers.image.base.digest="${OPENCLAW_NODE_BOOKWORM_SLIM_DIGEST}"
|
||||
|
||||
# ── Stage 3: Runtime ────────────────────────────────────────────
|
||||
|
|
@ -209,7 +209,7 @@ RUN ln -sf /app/openclaw.mjs /usr/local/bin/openclaw \
|
|||
ENV NODE_ENV=production
|
||||
|
||||
# Security hardening: Run as non-root user
|
||||
# The node:22-bookworm image includes a 'node' user (uid 1000)
|
||||
# The node:24-bookworm image includes a 'node' user (uid 1000)
|
||||
# This reduces the attack surface by preventing container escape via root privileges
|
||||
USER node
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ OpenClaw is a **self-hosted gateway** that connects your favorite chat apps —
|
|||
- **Agent-native**: built for coding agents with tool use, sessions, memory, and multi-agent routing
|
||||
- **Open source**: MIT licensed, community-driven
|
||||
|
||||
**What do you need?** Node 22+, an API key from your chosen provider, and 5 minutes. For best quality and security, use the strongest latest-generation model available.
|
||||
**What do you need?** Node 24 (recommended), or Node 22.12+ for compatibility, an API key from your chosen provider, and 5 minutes. For best quality and security, use the strongest latest-generation model available.
|
||||
|
||||
## How it works
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ The Ansible playbook installs and configures:
|
|||
1. **Tailscale** (mesh VPN for secure remote access)
|
||||
2. **UFW firewall** (SSH + Tailscale ports only)
|
||||
3. **Docker CE + Compose V2** (for agent sandboxes)
|
||||
4. **Node.js 22.x + pnpm** (runtime dependencies)
|
||||
4. **Node.js 24 + pnpm** (runtime dependencies; Node `22.12+` remains supported for compatibility)
|
||||
5. **OpenClaw** (host-based, not containerized)
|
||||
6. **Systemd service** (auto-start with security hardening)
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ bun run vitest run
|
|||
Bun may block dependency lifecycle scripts unless explicitly trusted (`bun pm untrusted` / `bun pm trust`).
|
||||
For this repo, the commonly blocked scripts are not required:
|
||||
|
||||
- `@whiskeysockets/baileys` `preinstall`: checks Node major >= 20 (we run Node 22+).
|
||||
- `@whiskeysockets/baileys` `preinstall`: checks Node major >= 20 (OpenClaw defaults to Node 24 and still supports Node `22.12+`).
|
||||
- `protobufjs` `postinstall`: emits warnings about incompatible version schemes (no build artifacts).
|
||||
|
||||
If you hit a real runtime issue that requires these scripts, trust them explicitly:
|
||||
|
|
|
|||
|
|
@ -165,13 +165,13 @@ Common tags:
|
|||
|
||||
The main Docker image currently uses:
|
||||
|
||||
- `node:22-bookworm`
|
||||
- `node:24-bookworm`
|
||||
|
||||
The docker image now publishes OCI base-image annotations (sha256 is an example,
|
||||
and points at the pinned multi-arch manifest list for that tag):
|
||||
|
||||
- `org.opencontainers.image.base.name=docker.io/library/node:22-bookworm`
|
||||
- `org.opencontainers.image.base.digest=sha256:b501c082306a4f528bc4038cbf2fbb58095d583d0419a259b2114b5ac53d12e9`
|
||||
- `org.opencontainers.image.base.name=docker.io/library/node:24-bookworm`
|
||||
- `org.opencontainers.image.base.digest=sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b`
|
||||
- `org.opencontainers.image.source=https://github.com/openclaw/openclaw`
|
||||
- `org.opencontainers.image.url=https://openclaw.ai`
|
||||
- `org.opencontainers.image.documentation=https://docs.openclaw.ai/install/docker`
|
||||
|
|
@ -408,7 +408,7 @@ To speed up rebuilds, order your Dockerfile so dependency layers are cached.
|
|||
This avoids re-running `pnpm install` unless lockfiles change:
|
||||
|
||||
```dockerfile
|
||||
FROM node:22-bookworm
|
||||
FROM node:24-bookworm
|
||||
|
||||
# Install Bun (required for build scripts)
|
||||
RUN curl -fsSL https://bun.sh/install | bash
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ If you add new skills later that depend on additional binaries, you must:
|
|||
**Example Dockerfile**
|
||||
|
||||
```dockerfile
|
||||
FROM node:22-bookworm
|
||||
FROM node:24-bookworm
|
||||
|
||||
RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ If you add new skills later that depend on additional binaries, you must:
|
|||
**Example Dockerfile**
|
||||
|
||||
```dockerfile
|
||||
FROM node:22-bookworm
|
||||
FROM node:24-bookworm
|
||||
|
||||
RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Already followed [Getting Started](/start/getting-started)? You're all set — t
|
|||
|
||||
## System requirements
|
||||
|
||||
- **[Node 22+](/install/node)** (the [installer script](#install-methods) will install it if missing)
|
||||
- **[Node 24 (recommended)](/install/node)** (`22.12+` is still supported for compatibility; the [installer script](#install-methods) will install Node 24 if missing)
|
||||
- macOS, Linux, or Windows
|
||||
- `pnpm` only if you build from source
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ For VPS/cloud hosts, avoid third-party "1-click" marketplace images when possibl
|
|||
</Accordion>
|
||||
|
||||
<Accordion title="npm / pnpm" icon="package">
|
||||
If you already have Node 22+ and prefer to manage the install yourself:
|
||||
If you already manage Node yourself, we recommend Node 24. OpenClaw still supports Node `22.12+` for compatibility:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="npm">
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ Recommended for most interactive installs on macOS/Linux/WSL.
|
|||
<Step title="Detect OS">
|
||||
Supports macOS and Linux (including WSL). If macOS is detected, installs Homebrew if missing.
|
||||
</Step>
|
||||
<Step title="Ensure Node.js 22+">
|
||||
Checks Node version and installs Node 22 if needed (Homebrew on macOS, NodeSource setup scripts on Linux apt/dnf/yum).
|
||||
<Step title="Ensure Node.js 24 by default">
|
||||
Checks Node version and installs Node 24 if needed (Homebrew on macOS, NodeSource setup scripts on Linux apt/dnf/yum). OpenClaw still supports Node `22.12+` for compatibility.
|
||||
</Step>
|
||||
<Step title="Ensure Git">
|
||||
Installs Git if missing.
|
||||
|
|
@ -175,7 +175,7 @@ Designed for environments where you want everything under a local prefix (defaul
|
|||
|
||||
<Steps>
|
||||
<Step title="Install local Node runtime">
|
||||
Downloads Node tarball (default `22.22.0`) to `<prefix>/tools/node-v<version>` and verifies SHA-256.
|
||||
Downloads a pinned supported Node tarball (currently default `22.22.0`) to `<prefix>/tools/node-v<version>` and verifies SHA-256.
|
||||
</Step>
|
||||
<Step title="Ensure Git">
|
||||
If Git is missing, attempts install via apt/dnf/yum on Linux or Homebrew on macOS.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ read_when:
|
|||
|
||||
# Node.js
|
||||
|
||||
OpenClaw requires **Node 22 or newer**. The [installer script](/install#install-methods) will detect and install Node automatically — this page is for when you want to set up Node yourself and make sure everything is wired up correctly (versions, PATH, global installs).
|
||||
OpenClaw requires **Node 22.12 or newer**. **Node 24 is the default and recommended runtime** for installs, CI, and release workflows. The [installer script](/install#install-methods) will detect and install Node automatically — this page is for when you want to set up Node yourself and make sure everything is wired up correctly (versions, PATH, global installs).
|
||||
|
||||
## Check your version
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ OpenClaw requires **Node 22 or newer**. The [installer script](/install#install-
|
|||
node -v
|
||||
```
|
||||
|
||||
If this prints `v22.x.x` or higher, you're good. If Node isn't installed or the version is too old, pick an install method below.
|
||||
If this prints `v24.x.x` or higher, you're on the recommended default. If it prints `v22.12.x` or higher, OpenClaw is still supported, but we recommend upgrading to Node 24 when convenient. If Node isn't installed or the version is too old, pick an install method below.
|
||||
|
||||
## Install Node
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ If this prints `v22.x.x` or higher, you're good. If Node isn't installed or the
|
|||
**Ubuntu / Debian:**
|
||||
|
||||
```bash
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
```
|
||||
|
||||
|
|
@ -77,8 +77,8 @@ If this prints `v22.x.x` or higher, you're good. If Node isn't installed or the
|
|||
Example with fnm:
|
||||
|
||||
```bash
|
||||
fnm install 22
|
||||
fnm use 22
|
||||
fnm install 24
|
||||
fnm use 24
|
||||
```
|
||||
|
||||
<Warning>
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ ssh root@YOUR_DROPLET_IP
|
|||
# Update system
|
||||
apt update && apt upgrade -y
|
||||
|
||||
# Install Node.js 22
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
||||
# Install Node.js 24
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
|
||||
apt install -y nodejs
|
||||
|
||||
# Install OpenClaw
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ Native Linux companion apps are planned. Contributions are welcome if you want t
|
|||
|
||||
## Beginner quick path (VPS)
|
||||
|
||||
1. Install Node 22+
|
||||
1. Install Node 24 (recommended; Node `22.12+` still works for compatibility)
|
||||
2. `npm i -g openclaw@latest`
|
||||
3. `openclaw onboard --install-daemon`
|
||||
4. From your laptop: `ssh -N -L 18789:127.0.0.1:18789 <user>@<host>`
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ running (or attaches to an existing local Gateway if one is already running).
|
|||
|
||||
## Install the CLI (required for local mode)
|
||||
|
||||
You need Node 22+ on the Mac, then install `openclaw` globally:
|
||||
Node 24 is the default runtime on the Mac. Node `22.12+` still works for compatibility. Then install `openclaw` globally:
|
||||
|
||||
```bash
|
||||
npm install -g openclaw@<version>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ This app is usually built from [`scripts/package-mac-app.sh`](https://github.com
|
|||
- calls [`scripts/codesign-mac-app.sh`](https://github.com/openclaw/openclaw/blob/main/scripts/codesign-mac-app.sh) to sign the main binary and app bundle so macOS treats each rebuild as the same signed bundle and keeps TCC permissions (notifications, accessibility, screen recording, mic, speech). For stable permissions, use a real signing identity; ad-hoc is opt-in and fragile (see [macOS permissions](/platforms/mac/permissions)).
|
||||
- uses `CODESIGN_TIMESTAMP=auto` by default; it enables trusted timestamps for Developer ID signatures. Set `CODESIGN_TIMESTAMP=off` to skip timestamping (offline debug builds).
|
||||
- inject build metadata into Info.plist: `OpenClawBuildTimestamp` (UTC) and `OpenClawGitCommit` (short hash) so the About pane can show build, git, and debug/release channel.
|
||||
- **Packaging requires Node 22+**: the script runs TS builds and the Control UI build.
|
||||
- **Packaging defaults to Node 24**: the script runs TS builds and the Control UI build. Node `22.12+` remains supported for compatibility.
|
||||
- reads `SIGN_IDENTITY` from the environment. Add `export SIGN_IDENTITY="Apple Development: Your Name (TEAMID)"` (or your Developer ID Application cert) to your shell rc to always sign with your cert. Ad-hoc signing requires explicit opt-in via `ALLOW_ADHOC_SIGNING=1` or `SIGN_IDENTITY="-"` (not recommended for permission testing).
|
||||
- runs a Team ID audit after signing and fails if any Mach-O inside the app bundle is signed by a different Team ID. Set `SKIP_TEAM_ID_CHECK=1` to bypass.
|
||||
|
||||
|
|
|
|||
|
|
@ -76,15 +76,15 @@ sudo apt install -y git curl build-essential
|
|||
sudo timedatectl set-timezone America/Chicago # Change to your timezone
|
||||
```
|
||||
|
||||
## 4) Install Node.js 22 (ARM64)
|
||||
## 4) Install Node.js 24 (ARM64)
|
||||
|
||||
```bash
|
||||
# Install Node.js via NodeSource
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
|
||||
sudo apt install -y nodejs
|
||||
|
||||
# Verify
|
||||
node --version # Should show v22.x.x
|
||||
node --version # Should show v24.x.x
|
||||
npm --version
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ read_when:
|
|||
|
||||
# Release Checklist (npm + macOS)
|
||||
|
||||
Use `pnpm` (Node 22+) from the repo root. Keep the working tree clean before tagging/publishing.
|
||||
Use `pnpm` from the repo root with Node 24 by default. Node `22.12+` remains supported for compatibility. Keep the working tree clean before tagging/publishing.
|
||||
|
||||
## Operator trigger
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ This script drives the interactive wizard via a pseudo-tty, verifies config/work
|
|||
|
||||
## QR import smoke (Docker)
|
||||
|
||||
Ensures `qrcode-terminal` loads under Node 22+ in Docker:
|
||||
Ensures `qrcode-terminal` loads under the supported Docker Node runtimes (Node 24 default, Node 22 compatible):
|
||||
|
||||
```bash
|
||||
pnpm test:docker:qr
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Docs: [Dashboard](/web/dashboard) and [Control UI](/web/control-ui).
|
|||
|
||||
## Prereqs
|
||||
|
||||
- Node 22 or newer
|
||||
- Node 24 recommended (`22.12+` still supported for compatibility)
|
||||
|
||||
<Tip>
|
||||
Check your Node version with `node --version` if you are unsure.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM node:22-bookworm-slim@sha256:3cfe526ec8dd62013b8843e8e5d4877e297b886e5aace4a59fec25dc20736e45
|
||||
FROM node:24-bookworm-slim@sha256:b4687aef2571c632a1953695ce4d61d6462a7eda471fe6e272eebf0418f276ba
|
||||
|
||||
RUN --mount=type=cache,id=openclaw-cleanup-smoke-apt-cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,id=openclaw-cleanup-smoke-apt-lists,target=/var/lib/apt,sharing=locked \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM node:22-bookworm-slim@sha256:3cfe526ec8dd62013b8843e8e5d4877e297b886e5aace4a59fec25dc20736e45
|
||||
FROM node:24-bookworm-slim@sha256:b4687aef2571c632a1953695ce4d61d6462a7eda471fe6e272eebf0418f276ba
|
||||
|
||||
RUN --mount=type=cache,id=openclaw-install-sh-e2e-apt-cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,id=openclaw-install-sh-e2e-apt-lists,target=/var/lib/apt,sharing=locked \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM node:22-bookworm-slim@sha256:3cfe526ec8dd62013b8843e8e5d4877e297b886e5aace4a59fec25dc20736e45
|
||||
FROM node:24-bookworm-slim@sha256:b4687aef2571c632a1953695ce4d61d6462a7eda471fe6e272eebf0418f276ba
|
||||
|
||||
RUN --mount=type=cache,id=openclaw-install-sh-smoke-apt-cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,id=openclaw-install-sh-smoke-apt-lists,target=/var/lib/apt,sharing=locked \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM node:22-bookworm@sha256:cd7bcd2e7a1e6f72052feb023c7f6b722205d3fcab7bbcbd2d1bfdab10b1e935
|
||||
FROM node:24-bookworm@sha256:9f3b13503acdf9bc1e0213ccb25ebe86ac881cad17636733a1da1be1d44509df
|
||||
|
||||
RUN corepack enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM node:22-bookworm@sha256:cd7bcd2e7a1e6f72052feb023c7f6b722205d3fcab7bbcbd2d1bfdab10b1e935
|
||||
FROM node:24-bookworm@sha256:9f3b13503acdf9bc1e0213ccb25ebe86ac881cad17636733a1da1be1d44509df
|
||||
|
||||
RUN corepack enable
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ MUTED='\033[38;2;90;100;128m' # text-muted #5a6480
|
|||
NC='\033[0m' # No Color
|
||||
|
||||
DEFAULT_TAGLINE="All your chats, one OpenClaw."
|
||||
NODE_DEFAULT_MAJOR=24
|
||||
NODE_MIN_MAJOR=22
|
||||
NODE_MIN_MINOR=12
|
||||
NODE_MIN_VERSION="${NODE_MIN_MAJOR}.${NODE_MIN_MINOR}"
|
||||
|
|
@ -1316,14 +1317,14 @@ print_active_node_paths() {
|
|||
return 0
|
||||
}
|
||||
|
||||
ensure_macos_node22_active() {
|
||||
ensure_macos_default_node_active() {
|
||||
if [[ "$OS" != "macos" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local brew_node_prefix=""
|
||||
if command -v brew &> /dev/null; then
|
||||
brew_node_prefix="$(brew --prefix node@22 2>/dev/null || true)"
|
||||
brew_node_prefix="$(brew --prefix "node@${NODE_DEFAULT_MAJOR}" 2>/dev/null || true)"
|
||||
if [[ -n "$brew_node_prefix" && -x "${brew_node_prefix}/bin/node" ]]; then
|
||||
export PATH="${brew_node_prefix}/bin:$PATH"
|
||||
refresh_shell_command_cache
|
||||
|
|
@ -1340,17 +1341,17 @@ ensure_macos_node22_active() {
|
|||
active_path="$(command -v node 2>/dev/null || echo "not found")"
|
||||
active_version="$(node -v 2>/dev/null || echo "missing")"
|
||||
|
||||
ui_error "Node.js v22 was installed but this shell is using ${active_version} (${active_path})"
|
||||
ui_error "Node.js v${NODE_DEFAULT_MAJOR} was installed but this shell is using ${active_version} (${active_path})"
|
||||
if [[ -n "$brew_node_prefix" ]]; then
|
||||
echo "Add this to your shell profile and restart shell:"
|
||||
echo " export PATH=\"${brew_node_prefix}/bin:\$PATH\""
|
||||
else
|
||||
echo "Ensure Homebrew node@22 is first on PATH, then rerun installer."
|
||||
echo "Ensure Homebrew node@${NODE_DEFAULT_MAJOR} is first on PATH, then rerun installer."
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
ensure_node22_active_shell() {
|
||||
ensure_default_node_active_shell() {
|
||||
if node_is_at_least_required; then
|
||||
return 0
|
||||
fi
|
||||
|
|
@ -1373,9 +1374,9 @@ ensure_node22_active_shell() {
|
|||
if [[ "$nvm_detected" -eq 1 ]]; then
|
||||
echo "nvm appears to be managing Node for this shell."
|
||||
echo "Run:"
|
||||
echo " nvm install 22"
|
||||
echo " nvm use 22"
|
||||
echo " nvm alias default 22"
|
||||
echo " nvm install ${NODE_DEFAULT_MAJOR}"
|
||||
echo " nvm use ${NODE_DEFAULT_MAJOR}"
|
||||
echo " nvm alias default ${NODE_DEFAULT_MAJOR}"
|
||||
echo "Then open a new shell and rerun:"
|
||||
echo " curl -fsSL https://openclaw.ai/install.sh | bash"
|
||||
else
|
||||
|
|
@ -1410,9 +1411,9 @@ check_node() {
|
|||
install_node() {
|
||||
if [[ "$OS" == "macos" ]]; then
|
||||
ui_info "Installing Node.js via Homebrew"
|
||||
run_quiet_step "Installing node@22" brew install node@22
|
||||
brew link node@22 --overwrite --force 2>/dev/null || true
|
||||
if ! ensure_macos_node22_active; then
|
||||
run_quiet_step "Installing node@${NODE_DEFAULT_MAJOR}" brew install "node@${NODE_DEFAULT_MAJOR}"
|
||||
brew link "node@${NODE_DEFAULT_MAJOR}" --overwrite --force 2>/dev/null || true
|
||||
if ! ensure_macos_default_node_active; then
|
||||
exit 1
|
||||
fi
|
||||
ui_success "Node.js installed"
|
||||
|
|
@ -1435,7 +1436,7 @@ install_node() {
|
|||
else
|
||||
run_quiet_step "Installing Node.js" sudo pacman -Sy --noconfirm nodejs npm
|
||||
fi
|
||||
ui_success "Node.js v22 installed"
|
||||
ui_success "Node.js v${NODE_DEFAULT_MAJOR} installed"
|
||||
print_active_node_paths || true
|
||||
return 0
|
||||
fi
|
||||
|
|
@ -1444,7 +1445,7 @@ install_node() {
|
|||
if command -v apt-get &> /dev/null; then
|
||||
local tmp
|
||||
tmp="$(mktempfile)"
|
||||
download_file "https://deb.nodesource.com/setup_22.x" "$tmp"
|
||||
download_file "https://deb.nodesource.com/setup_${NODE_DEFAULT_MAJOR}.x" "$tmp"
|
||||
if is_root; then
|
||||
run_quiet_step "Configuring NodeSource repository" bash "$tmp"
|
||||
run_quiet_step "Installing Node.js" apt-get install -y -qq nodejs
|
||||
|
|
@ -1455,7 +1456,7 @@ install_node() {
|
|||
elif command -v dnf &> /dev/null; then
|
||||
local tmp
|
||||
tmp="$(mktempfile)"
|
||||
download_file "https://rpm.nodesource.com/setup_22.x" "$tmp"
|
||||
download_file "https://rpm.nodesource.com/setup_${NODE_DEFAULT_MAJOR}.x" "$tmp"
|
||||
if is_root; then
|
||||
run_quiet_step "Configuring NodeSource repository" bash "$tmp"
|
||||
run_quiet_step "Installing Node.js" dnf install -y -q nodejs
|
||||
|
|
@ -1466,7 +1467,7 @@ install_node() {
|
|||
elif command -v yum &> /dev/null; then
|
||||
local tmp
|
||||
tmp="$(mktempfile)"
|
||||
download_file "https://rpm.nodesource.com/setup_22.x" "$tmp"
|
||||
download_file "https://rpm.nodesource.com/setup_${NODE_DEFAULT_MAJOR}.x" "$tmp"
|
||||
if is_root; then
|
||||
run_quiet_step "Configuring NodeSource repository" bash "$tmp"
|
||||
run_quiet_step "Installing Node.js" yum install -y -q nodejs
|
||||
|
|
@ -1480,7 +1481,7 @@ install_node() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
ui_success "Node.js v22 installed"
|
||||
ui_success "Node.js v${NODE_DEFAULT_MAJOR} installed"
|
||||
print_active_node_paths || true
|
||||
fi
|
||||
}
|
||||
|
|
@ -2267,7 +2268,7 @@ main() {
|
|||
if ! check_node; then
|
||||
install_node
|
||||
fi
|
||||
if ! ensure_node22_active_shell; then
|
||||
if ! ensure_default_node_active_shell; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ describe("Dockerfile", () => {
|
|||
it("uses shared multi-arch base image refs for all root Node stages", async () => {
|
||||
const dockerfile = await readFile(dockerfilePath, "utf8");
|
||||
expect(dockerfile).toContain(
|
||||
'ARG OPENCLAW_NODE_BOOKWORM_IMAGE="node:22-bookworm@sha256:b501c082306a4f528bc4038cbf2fbb58095d583d0419a259b2114b5ac53d12e9"',
|
||||
'ARG OPENCLAW_NODE_BOOKWORM_IMAGE="node:24-bookworm@sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b"',
|
||||
);
|
||||
expect(dockerfile).toContain(
|
||||
'ARG OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE="node:22-bookworm-slim@sha256:9c2c405e3ff9b9afb2873232d24bb06367d649aa3e6259cbe314da59578e81e9"',
|
||||
'ARG OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE="node:24-bookworm-slim@sha256:e8e2e91b1378f83c5b2dd15f0247f34110e2fe895f6ca7719dbb780f929368eb"',
|
||||
);
|
||||
expect(dockerfile).toContain("FROM ${OPENCLAW_NODE_BOOKWORM_IMAGE} AS ext-deps");
|
||||
expect(dockerfile).toContain("FROM ${OPENCLAW_NODE_BOOKWORM_IMAGE} AS build");
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ function formatLocalSetupError(err: unknown): string {
|
|||
: undefined,
|
||||
missing && detail ? `Detail: ${detail}` : null,
|
||||
"To enable local embeddings:",
|
||||
"1) Use Node 22 LTS (recommended for installs/updates)",
|
||||
"1) Use Node 24 (recommended for installs/updates; Node 22.12+ remains supported)",
|
||||
missing
|
||||
? "2) Reinstall OpenClaw (this should install node-llama-cpp): npm i -g openclaw@latest"
|
||||
: null,
|
||||
|
|
|
|||
Loading…
Reference in New Issue