Guide Menu expand_more
install vps
Node 24 Setup for OpenClaw
Prepare a compatible Node runtime for OpenClaw and avoid common PATH, npm, and shell confusion.
Why Node 24?
OpenClaw requires a stable and compatible version of Node.js to run the Gateway, plugins, and CLI tools. Node 24 (LTS) is the recommended version. Older Node versions (like Node 16 or 18) lack modern JavaScript features and will crash during dependency installation, while extremely new experimental versions might cause compatibility warnings.
Hinglish Summary: Simple words mein, Node.js ek javascript runtime environment hai jo OpenClaw ke server code ko run karne ke liye zaroori hai. Agar Node version purana hoga, toh dashboard aur bot tools break ho jayenge.
Method 1: Install using NVM (Recommended)
NVM (Node Version Manager) is the best way to install and manage Node.js because it allows you to switch between versions easily without messing up system-level folders.
Step 1: Install NVM
Run the official installer script to download and install NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Step 2: Load NVM into your current shell session
To start using NVM without restarting your terminal, load it by running:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Step 3: Install Node 24
Install the latest Node 24 LTS release:
nvm install 24
nvm use 24
nvm alias default 24
Step 4: Verify installation
Run these commands to confirm Node and NPM are installed:
node -v
npm -v
Expected output:
- Node:
v24.x.y(e.g.v24.1.0) - NPM:
10.x.yor newer.
Method 2: Install via NodeSource APT (System-Wide)
If you are setting up OpenClaw to run under a dedicated system user (e.g. openclaw) or using a systemd service that needs a global path, installing via NodeSource APT is preferred.
Step 1: Download and import the NodeSource security GPG key
Run this command to fetch the NodeSource setup script and add it to your package manager:
sudo apt-get update
sudo apt-get install -y curl grid-ui gnupg
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
Step 2: Create NodeSource repository list
Inject the Node 24 repository URL:
NODE_MAJOR=24
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
Step 3: Install Node.js
Update your local index and install:
sudo apt-get update
sudo apt-get install nodejs -y
Step 4: Verify system installation
node -v
npm -v
Expected output:
v24.x.yrunning from/usr/bin/node.
Troubleshooting Common Errors
1. Command 'node' not found after logging out
This happens when you install Node using NVM, but your process manager (like PM2 or systemd) doesn’t load the shell profile (.bashrc or .zshrc) where NVM is initialized.
- Fix: Either use the absolute path to the Node binary in your service configs (e.g.
/home/ubuntu/.nvm/versions/node/v24.x.y/bin/node) or install Node globally via Method 2.
2. EACCES Permission errors during npm global install
If you run npm install -g pm2 and get permission errors, you are trying to install global packages into a directory owned by root.
- Fix: If using NVM, this shouldn’t happen. If using APT, configure a custom prefix for global packages or run:
sudo npm install -g pm2 --unsafe-perm
Next Steps
Now that Node 24 is configured, you can proceed to:
- Read Install OpenClaw without Docker
- Learn how to keep OpenClaw running in the background with Run OpenClaw After Logout
ClawReady.in is an independent educational resource and setup service. It is not affiliated with, endorsed by, or operated by OpenClaw.