| name | openclaw-upgrade |
| description | Upgrade OpenClaw installations to the latest version. Handles global npm installs, local development setups, release channels (stable/beta/dev), configuration preservation, and platform-specific requirements. Use when updating OpenClaw, switching release channels, or troubleshooting update issues. |
OpenClaw Upgrade Skill
Complete upgrade management for OpenClaw installations across different environments and platforms.
Core Upgrade Commands
Global NPM Installation (Most Common)
Stable Release (Latest)
sudo npm i -g openclaw@latest
Beta Release
sudo npm i -g openclaw@beta
Specific Version
sudo npm i -g openclaw@2026.2.15
Dev Channel (Main Branch)
git clone https://github.com/openclaw/openclaw.git /tmp/openclaw-dev
cd /tmp/openclaw-dev
pnpm install
pnpm build
sudo npm link
Environment-Specific Upgrades
exe.dev VM Upgrade
ssh exe.dev
ssh vm-name
pkill -f openclaw-gateway || true
sleep 5
pkill -9 -f openclaw-gateway 2>/dev/null || true
sudo npm i -g openclaw@latest
openclaw --version
nohup openclaw gateway run --bind loopback --port 18789 --force > /tmp/openclaw-gateway.log 2>&1 &
openclaw channels status --probe
ss -ltnp | rg 18789
tail -n 120 /tmp/openclaw-gateway.log
macOS App Upgrade
osascript -e 'quit app "OpenClaw"'
cd ~/code/openclaw
git pull --rebase origin main
pnpm install
pnpm build
scripts/package-mac-app.sh
cp -R dist/mac/OpenClaw.app /Applications/
open -a OpenClaw
Local Development Setup
cd ~/code/openclaw
git status
git fetch origin
git checkout main
git pull --rebase origin main
pnpm install
pnpm build
pnpm test
Configuration Preservation
Backup Before Upgrade
openclaw config export > ~/.openclaw-config-backup-$(date +%Y%m%d).json
cp -R ~/.openclaw/credentials ~/.openclaw-credentials-backup-$(date +%Y%m%d)
cp -R ~/.openclaw/sessions ~/.openclaw-sessions-backup-$(date +%Y%m%d)
Restore After Upgrade
openclaw config import < ~/.openclaw-config-backup-YYYYMMDD.json
cp -R ~/.openclaw-credentials-backup-YYYYMMDD/* ~/.openclaw/credentials/
openclaw config list
openclaw channels status
Version Management
Check Current Version
openclaw --version
npm view openclaw version --userconfig "$(mktemp)"
npm view openclaw@beta version --userconfig "$(mktemp)"
List All Available Versions
npm view openclaw versions --json | jq -r '.[]' | tail -20
Downgrade If Needed
sudo npm i -g openclaw@2026.2.14
openclaw --version
Release Channel Information
Channel Types
Troubleshooting
Permission Issues
sudo npm i -g openclaw@latest
nvm use 22
npm i -g openclaw@latest
Cache Issues
npm cache clean --force
sudo npm i -g openclaw@latest --force
Gateway Won't Start After Upgrade
openclaw doctor
openclaw config set gateway.mode local
lsof -i :18789
Service Stuck in Restart Loop (systemd)
systemctl --user status openclaw-gateway.service
journalctl --user -u openclaw-gateway.service -n 50 --no-pager
systemctl --user stop openclaw-gateway.service
Missing Dependencies (ERR_MODULE_NOT_FOUND)
Common after upgrades or partial rebuilds. The long package is a frequent culprit.
systemctl --user stop openclaw-gateway.service
cd ~/code/openclaw
rm -rf node_modules pnpm-lock.yaml
pnpm install
pnpm add -w long
pnpm build
systemctl --user start openclaw-gateway.service
openclaw channels status --probe
Build Failures After Dependency Fix
cd ~/code/openclaw
rm -rf node_modules dist .turbo
pnpm install
pnpm build
pnpm canvas:a2ui:bundle
pnpm build
Configuration Lost After Upgrade
ls -la ~/.openclaw/config.json
ls -la ~/.openclaw/config.json.*
openclaw config set gateway.mode local
openclaw config set gateway.port 18789
Platform-Specific Notes
Docker Environments
npm i -g openclaw@latest
docker build --build-arg OPENCLAW_VERSION=latest -t openclaw:latest .
CI/CD Pipelines
- name: Install OpenClaw
run: |
npm i -g openclaw@latest
openclaw --version
Homebrew (macOS)
brew upgrade openclaw
brew uninstall openclaw
npm i -g openclaw@latest
Advanced Scenarios
Multi-Version Testing
npx openclaw@2026.2.14 --version
npx openclaw@latest --version
Build from Specific Commit
cd ~/code/openclaw
git fetch origin
git checkout <commit-hash>
pnpm install
pnpm build
sudo npm link
Plugin Compatibility Check
openclaw plugins list
openclaw plugins verify
cd extensions/<plugin-name>
npm install --omit=dev
Common Issues and Solutions
The "long" Package Missing Issue
After certain upgrades or dependency updates, the gateway may fail with:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'long' imported from
/home/user/code/openclaw/node_modules/.pnpm/@whiskeysockets+baileys@*/...
This is commonly caused by incomplete dependency resolution. Solution:
cd ~/code/openclaw
systemctl --user stop openclaw-gateway.service
pnpm add -w long
pnpm build
systemctl --user start openclaw-gateway.service
Service Restart Loop Detection
If the service shows high restart counts (e.g., "restart counter is at 72"):
- Stop the service immediately to prevent resource waste
- Check logs for the root cause (usually dependency issues)
- Fix the underlying issue
- Clear service failure state before restarting
Best Practices
- Always backup configuration before major upgrades
- Test in development environment first
- Check changelog for breaking changes
- Verify gateway connectivity after upgrade
- Keep logs during upgrade for debugging
- Monitor service restart count after upgrades
- Clean reinstall dependencies if mysterious errors occur
Quick Upgrade Script
Use the provided upgrade script for safe, automated upgrades:
~/.agents/skills/openclaw-upgrade/scripts/upgrade.sh
~/.agents/skills/openclaw-upgrade/scripts/upgrade.sh --help
~/.agents/skills/openclaw-upgrade/scripts/upgrade.sh beta
~/.agents/skills/openclaw-upgrade/scripts/upgrade.sh 2026.3.1
The script handles:
- Configuration backup
- Dependency verification
- Service restart loop detection
- Automatic dependency fixes
- Rollback on failure
Rollback Procedure
pkill -f openclaw || true
sudo npm i -g openclaw@<previous-version>
openclaw config import < ~/.openclaw-backup-YYYYMMDD.json
openclaw gateway run