2026-01-16 23:10:10 +00:00
---
2026-02-06 08:55:05 -05:00
title: "Node.js"
summary: "Install and configure Node.js for OpenClaw — version requirements, install options, and PATH troubleshooting"
2026-01-16 23:10:10 +00:00
read_when:
2026-02-06 08:55:05 -05:00
- "You need to install Node.js before installing OpenClaw"
- "You installed OpenClaw but `openclaw` is command not found"
- "npm install -g fails with permissions or PATH issues"
2026-01-16 23:10:10 +00:00
---
2026-02-06 08:55:05 -05:00
# Node.js
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
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).
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
## Check your version
2026-01-16 23:10:10 +00:00
``` bash
node -v
```
2026-02-06 08:55:05 -05:00
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.
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
## Install Node
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
<Tabs>
<Tab title="macOS">
**Homebrew ** (recommended):
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
```bash
brew install node
` ``
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
Or download the macOS installer from [nodejs.org](https://nodejs.org/).
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
</Tab>
<Tab title="Linux">
**Ubuntu / Debian:**
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
` ``bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
` ``
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
**Fedora / RHEL:**
` ``bash
sudo dnf install nodejs
` ``
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
Or use a version manager (see below).
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
</Tab>
<Tab title="Windows">
**winget** (recommended):
2026-01-22 04:26:18 +00:00
2026-02-06 08:55:05 -05:00
` ``powershell
winget install OpenJS.NodeJS.LTS
` ``
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
**Chocolatey:**
` ``powershell
choco install nodejs-lts
` ``
Or download the Windows installer from [nodejs.org](https://nodejs.org/).
</Tab>
</Tabs>
<Accordion title="Using a version manager (nvm, fnm, mise, asdf)">
Version managers let you switch between Node versions easily. Popular options:
- [**fnm**](https://github.com/Schniz/fnm) — fast, cross-platform
- [**nvm**](https://github.com/nvm-sh/nvm) — widely used on macOS/Linux
- [**mise**](https://mise.jdx.dev/) — polyglot (Node, Python, Ruby, etc.)
Example with fnm:
2026-01-16 23:10:10 +00:00
` ``bash
2026-02-06 08:55:05 -05:00
fnm install 22
fnm use 22
2026-01-16 23:10:10 +00:00
` ``
2026-02-06 08:55:05 -05:00
<Warning>
Make sure your version manager is initialized in your shell startup file (` ~/.zshrc` or ` ~/.bashrc`). If it isn't, ` openclaw` may not be found in new terminal sessions because the PATH won't include Node's bin directory.
</Warning>
</Accordion>
## Troubleshooting
### ` openclaw: command not found`
This almost always means npm's global bin directory isn't on your PATH.
<Steps>
<Step title="Find your global npm prefix">
` ``bash
npm prefix -g
` ``
</Step>
<Step title="Check if it's on your PATH">
` ``bash
echo "$PATH"
` ``
Look for ` <npm-prefix>/bin` (macOS/Linux) or ` <npm-prefix>` (Windows) in the output.
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
</Step>
<Step title="Add it to your shell startup file">
<Tabs>
<Tab title="macOS / Linux">
Add to ` ~/.zshrc` or ` ~/.bashrc`:
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
` ``bash
export PATH="$(npm prefix -g)/bin:$PATH"
` ``
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
Then open a new terminal (or run ` rehash` in zsh / ` hash -r` in bash).
</Tab>
<Tab title="Windows">
Add the output of ` npm prefix -g` to your system PATH via Settings → System → Environment Variables.
</Tab>
</Tabs>
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
</Step>
</Steps>
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
### Permission errors on ` npm install -g` (Linux)
If you see ` EACCES` errors, switch npm's global prefix to a user-writable directory:
` ``bash
mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH"
` ``
2026-01-16 23:10:10 +00:00
2026-02-06 08:55:05 -05:00
Add the ` export PATH=...` line to your ` ~/.bashrc` or ` ~/.zshrc` to make it permanent.