Skip to content

fix(install): detect NVM and warn if old Node version is active#74

Open
kevinWangSheng wants to merge 1 commit intoopenclaw:mainfrom
kevinWangSheng:fix/nvm-detection
Open

fix(install): detect NVM and warn if old Node version is active#74
kevinWangSheng wants to merge 1 commit intoopenclaw:mainfrom
kevinWangSheng:fix/nvm-detection

Conversation

@kevinWangSheng
Copy link

Problem

Fixes #24881

On systems using NVM with an old default Node version (e.g., v16), the installer would install Node 22 via NodeSource, but the shell would continue using NVM's old Node, causing npm install to fail.

Solution

Add detect_nvm_and_warn() function that:

  1. Detects if NVM is installed (NVM_DIR or ~/.nvm/nvm.sh)
  2. Checks if current Node is from NVM and version < 22
  3. Shows clear instructions and exits with error if so

Testing

  • Bash syntax validation passed
  • Manual testing on NVM system needed

Screenshot of warning

⚠️  NVM detected with old default Node version
   Your shell is using NVM's Node v16.14.2, but OpenClaw requires Node 22+

To fix this, run:
  nvm install 22
  nvm use 22
  nvm alias default 22

Then restart your terminal and run the installer again.

- Add detect_nvm_and_warn() function to check for NVM presence
- If NVM is installed with old default Node (< v22), show clear instructions
- Prevents confusing installation failures on NVM-managed systems

Fixes #24881
@vercel
Copy link

vercel bot commented Feb 24, 2026

Someone is attempting to deploy a commit to the Jamie's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant