mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 23:07:27 +00:00
Docs: sharpen Install tab to stop duplicating Getting Started (#10416)
* docs(install): reframe install overview to stop duplicating getting started * docs(install): link default installer row to getting started, not internals * docs(install): use Mintlify components for install overview * docs(install): fix card grid layout with CardGroup * docs(install): platform tabs for global install, npm/pnpm as accordion * docs(install): add PowerShell no-onboard alternative * docs(install): add repo link to from-source clone step * docs(install): capitalize OpenClaw in repo link * docs(install): add pnpm link --global to from-source steps * docs(install): rewrite install overview for clarity and flow * docs(install): use tooltip for Windows WSL2 recommendation * docs(install): use Note box for Windows WSL2 recommendation * docs(install): group install methods under single heading * docs(install): standardize tab labels across installer sections * docs(install): rewrite Node.js page with install instructions and better structure * docs(install): clarify Node.js page intro * docs(install): scope auto-install note to installer script, link Node page * docs(install): fix installer script link to internals page * docs: rename Install methods nav group to Other install methods * docs(install): link to on-page anchor, use Tip box for recommended * docs(install): wrap install methods in AccordionGroup with Tip box * docs: move Node.js page from Install to Help > Environment and debugging * docs(install): add complete flags and env vars reference to installer internals * docs(install): use stable troubleshooting anchor for Node.js link * docs(install): fix Node page installer anchor * docs(install): fix broken installer script anchor in requirements note
This commit is contained in:
@@ -1,58 +1,133 @@
|
||||
---
|
||||
title: "Node.js + npm (PATH sanity)"
|
||||
summary: "Node.js + npm install sanity: versions, PATH, and global installs"
|
||||
title: "Node.js"
|
||||
summary: "Install and configure Node.js for OpenClaw — version requirements, install options, and PATH troubleshooting"
|
||||
read_when:
|
||||
- "You installed OpenClaw but `openclaw` is “command not found”"
|
||||
- "You’re setting up Node.js/npm on a new machine"
|
||||
- "npm install -g ... fails with permissions or PATH issues"
|
||||
- "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"
|
||||
---
|
||||
|
||||
# Node.js + npm (PATH sanity)
|
||||
# Node.js
|
||||
|
||||
OpenClaw’s runtime baseline is **Node 22+**.
|
||||
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).
|
||||
|
||||
If you can run `npm install -g openclaw@latest` but later see `openclaw: command not found`, it’s almost always a **PATH** issue: the directory where npm puts global binaries isn’t on your shell’s PATH.
|
||||
|
||||
## Quick diagnosis
|
||||
|
||||
Run:
|
||||
## Check your version
|
||||
|
||||
```bash
|
||||
node -v
|
||||
npm -v
|
||||
npm prefix -g
|
||||
echo "$PATH"
|
||||
```
|
||||
|
||||
If `$(npm prefix -g)/bin` (macOS/Linux) or `$(npm prefix -g)` (Windows) is **not** present inside `echo "$PATH"`, your shell can’t find global npm binaries (including `openclaw`).
|
||||
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.
|
||||
|
||||
## Fix: put npm’s global bin dir on PATH
|
||||
## Install Node
|
||||
|
||||
1. Find your global npm prefix:
|
||||
<Tabs>
|
||||
<Tab title="macOS">
|
||||
**Homebrew** (recommended):
|
||||
|
||||
```bash
|
||||
brew install node
|
||||
```
|
||||
|
||||
Or download the macOS installer from [nodejs.org](https://nodejs.org/).
|
||||
|
||||
</Tab>
|
||||
<Tab title="Linux">
|
||||
**Ubuntu / Debian:**
|
||||
|
||||
```bash
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
```
|
||||
|
||||
**Fedora / RHEL:**
|
||||
|
||||
```bash
|
||||
sudo dnf install nodejs
|
||||
```
|
||||
|
||||
Or use a version manager (see below).
|
||||
|
||||
</Tab>
|
||||
<Tab title="Windows">
|
||||
**winget** (recommended):
|
||||
|
||||
```powershell
|
||||
winget install OpenJS.NodeJS.LTS
|
||||
```
|
||||
|
||||
**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:
|
||||
|
||||
```bash
|
||||
npm prefix -g
|
||||
fnm install 22
|
||||
fnm use 22
|
||||
```
|
||||
|
||||
2. Add the global npm bin directory to your shell startup file:
|
||||
<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>
|
||||
|
||||
- zsh: `~/.zshrc`
|
||||
- bash: `~/.bashrc`
|
||||
## Troubleshooting
|
||||
|
||||
Example (replace the path with your `npm prefix -g` output):
|
||||
### `openclaw: command not found`
|
||||
|
||||
```bash
|
||||
# macOS / Linux
|
||||
export PATH="/path/from/npm/prefix/bin:$PATH"
|
||||
```
|
||||
This almost always means npm's global bin directory isn't on your PATH.
|
||||
|
||||
Then open a **new terminal** (or run `rehash` in zsh / `hash -r` in bash).
|
||||
<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"
|
||||
```
|
||||
|
||||
On Windows, add the output of `npm prefix -g` to your PATH.
|
||||
Look for `<npm-prefix>/bin` (macOS/Linux) or `<npm-prefix>` (Windows) in the output.
|
||||
|
||||
## Fix: avoid `sudo npm install -g` / permission errors (Linux)
|
||||
</Step>
|
||||
<Step title="Add it to your shell startup file">
|
||||
<Tabs>
|
||||
<Tab title="macOS / Linux">
|
||||
Add to `~/.zshrc` or `~/.bashrc`:
|
||||
|
||||
If `npm install -g ...` fails with `EACCES`, switch npm’s global prefix to a user-writable directory:
|
||||
```bash
|
||||
export PATH="$(npm prefix -g)/bin:$PATH"
|
||||
```
|
||||
|
||||
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>
|
||||
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### 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"
|
||||
@@ -60,19 +135,4 @@ npm config set prefix "$HOME/.npm-global"
|
||||
export PATH="$HOME/.npm-global/bin:$PATH"
|
||||
```
|
||||
|
||||
Persist the `export PATH=...` line in your shell startup file.
|
||||
|
||||
## Recommended Node install options
|
||||
|
||||
You’ll have the fewest surprises if Node/npm are installed in a way that:
|
||||
|
||||
- keeps Node updated (22+)
|
||||
- makes the global npm bin dir stable and on PATH in new shells
|
||||
|
||||
Common choices:
|
||||
|
||||
- macOS: Homebrew (`brew install node`) or a version manager
|
||||
- Linux: your preferred version manager, or a distro-supported install that provides Node 22+
|
||||
- Windows: official Node installer, `winget`, or a Windows Node version manager
|
||||
|
||||
If you use a version manager (nvm/fnm/asdf/etc), ensure it’s initialized in the shell you use day-to-day (zsh vs bash) so the PATH it sets is present when you run installers.
|
||||
Add the `export PATH=...` line to your `~/.bashrc` or `~/.zshrc` to make it permanent.
|
||||
|
||||
Reference in New Issue
Block a user