Skip to content

fix: resolve PATH issues after nvm installs Node.js#228

Merged
liveaverage merged 1 commit into
mainfrom
fix/issue-205-installer-path
Mar 17, 2026
Merged

fix: resolve PATH issues after nvm installs Node.js#228
liveaverage merged 1 commit into
mainfrom
fix/issue-205-installer-path

Conversation

@ericksoa

Copy link
Copy Markdown
Contributor

Summary

Fixes #205. After curl -fsSL https://nvidia.com/nemoclaw.sh | bash installs Node.js via nvm, the parent shell doesn't have the updated PATH. Both nemoclaw and node are "command not found" until the user manually opens a new terminal.

Root cause (primary): The installer runs in a subshell via curl | bash. nvm sources into that subshell and updates PATH, but when the subshell exits, all PATH changes are lost.

Root cause (secondary): onboard.js called the full scripts/install.sh to install openshell, which unnecessarily reinstalled Node, Docker, and nemoclaw in a nested subprocess — compounding the PATH issue.

Changes

scripts/install.sh:

  • Add ensure_nvm_loaded() and refresh_path() to explicitly update PATH after npm installs nemoclaw
  • Add nvm fallback detection for $HOME/.nvm when NVM_DIR is not exported (common in Docker containers)
  • Soften verification: warn with instructions instead of hard-failing when the binary exists but isn't on PATH (install succeeded, PATH is stale)
  • Add post-install message telling nvm/fnm users to run source ~/.bashrc
  • Use sudo for npm install -g when NODE_MGR=nodesource (system Node requires root for global installs)

install.sh (root):

  • Soften verify_nemoclaw() to return 0 when the binary exists but PATH is stale (was a hard error)
  • Add post_install_message() function with shell reload instructions

bin/lib/onboard.js:

  • Switch installOpenshell() to use dedicated install-openshell.sh instead of the full scripts/install.sh

scripts/install-openshell.sh (new):

  • Dedicated openshell-only installer with macOS + Linux support and conditional sudo

Test plan

  • 58/58 unit tests pass (node --test test/*.test.js)
  • 24/24 E2E tests pass (see test: add full live E2E test (install → onboard → inference) #226)
  • Shell syntax check passes on all 3 scripts (bash -n)
  • Verified install-openshell.sh handles both Darwin and Linux asset names
  • Verified refresh_path() uses POSIX-compatible case for PATH dedup check
  • Verified post-install message detects correct shell profile (.bashrc vs .zshrc vs .profile)

Fixes #205.

Root cause: when the installer runs via `curl | bash`, nvm sources
into the subshell and updates PATH. When the subshell exits, all PATH
changes are lost — the user's interactive shell still has the old PATH,
so `nemoclaw` and `node` are both "command not found".

Additionally, `onboard.js` called the full `scripts/install.sh` just to
install openshell, which unnecessarily reinstalled Node, Docker, and
nemoclaw in a nested subprocess — compounding the PATH issue.

Changes:

scripts/install.sh:
- Add ensure_nvm_loaded() and refresh_path() to update PATH after
  npm installs nemoclaw
- Add nvm fallback detection for $HOME/.nvm when NVM_DIR is unset
- Soften verification: warn with instructions instead of hard-failing
  when the binary exists but isn't on PATH (exit 0, not exit 1)
- Add post-install message telling nvm/fnm users to `source ~/.bashrc`
- Use sudo for npm install -g when NODE_MGR=nodesource

install.sh (root):
- Soften verify_nemoclaw() to return 0 when binary exists but PATH
  is stale (was hard error via error())
- Add post_install_message() for shell reload instructions

bin/lib/onboard.js:
- Switch installOpenshell() to use dedicated install-openshell.sh
  instead of the full scripts/install.sh

scripts/install-openshell.sh (new):
- Dedicated openshell-only installer with macOS + Linux support
  and conditional sudo

Tested: 58/58 unit tests pass, 24/24 E2E tests pass (see PR #226).
@liveaverage

Copy link
Copy Markdown
Contributor

Reproduced the issue on main using the same stale-PATH setup: I removed the nvm Node bin from PATH and ran install.sh. On main, onboarding hit the old nested installer path and failed with:

  [install] Installing nemoclaw CLI...
  [install] nemoclaw not found in PATH after install. Check your Node.js bin directory.

That is the core reported problem: install succeeded underneath, but the shell still had stale PATH, so the nested flow treated it as a failure.

Then I ran the same stale-PATH scenario on PR #228 -- In that run, the installer recovered correctly:

  • it loaded nvm
  • refreshed PATH
  • verified nemoclaw at /home/liveaverage/.nvm/versions/node/v22.22.1/bin/nemoclaw
  • successfully invoked nemoclaw onboard in the same shell
  • when openshell was missing, it used the new dedicated install-openshell.sh path instead of recursing through the full installer

@liveaverage liveaverage self-requested a review March 17, 2026 18:39

@liveaverage liveaverage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reproduced the issue on main using the same stale-PATH setup: I removed the nvm Node bin from PATH and ran install.sh. On main, onboarding hit the old nested installer path and failed with:

  [install] Installing nemoclaw CLI...
  [install] nemoclaw not found in PATH after install. Check your Node.js bin directory.

That is the core reported problem: install succeeded underneath, but the shell still had stale PATH, so the nested flow treated it as a failure.

Then I ran the same stale-PATH scenario on PR #228...In that run, the installer recovered correctly:

  • it loaded nvm
  • refreshed PATH
  • verified nemoclaw at /home/liveaverage/.nvm/versions/node/v22.22.1/bin/nemoclaw
  • successfully invoked nemoclaw onboard in the same shell
  • when openshell was missing, it used the new dedicated install-openshell.sh path instead of recursing through the full installer

@liveaverage liveaverage merged commit 90c832d into main Mar 17, 2026
Ryuketsukami pushed a commit to Ryuketsukami/NemoClaw that referenced this pull request Mar 24, 2026
Fixes NVIDIA#205.

Root cause: when the installer runs via `curl | bash`, nvm sources
into the subshell and updates PATH. When the subshell exits, all PATH
changes are lost — the user's interactive shell still has the old PATH,
so `nemoclaw` and `node` are both "command not found".

Additionally, `onboard.js` called the full `scripts/install.sh` just to
install openshell, which unnecessarily reinstalled Node, Docker, and
nemoclaw in a nested subprocess — compounding the PATH issue.

Changes:

scripts/install.sh:
- Add ensure_nvm_loaded() and refresh_path() to update PATH after
  npm installs nemoclaw
- Add nvm fallback detection for $HOME/.nvm when NVM_DIR is unset
- Soften verification: warn with instructions instead of hard-failing
  when the binary exists but isn't on PATH (exit 0, not exit 1)
- Add post-install message telling nvm/fnm users to `source ~/.bashrc`
- Use sudo for npm install -g when NODE_MGR=nodesource

install.sh (root):
- Soften verify_nemoclaw() to return 0 when binary exists but PATH
  is stale (was hard error via error())
- Add post_install_message() for shell reload instructions

bin/lib/onboard.js:
- Switch installOpenshell() to use dedicated install-openshell.sh
  instead of the full scripts/install.sh

scripts/install-openshell.sh (new):
- Dedicated openshell-only installer with macOS + Linux support
  and conditional sudo

Tested: 58/58 unit tests pass, 24/24 E2E tests pass (see PR NVIDIA#226).
jessesanford pushed a commit to jessesanford/NemoClaw that referenced this pull request Mar 24, 2026
Fixes NVIDIA#205.

Root cause: when the installer runs via `curl | bash`, nvm sources
into the subshell and updates PATH. When the subshell exits, all PATH
changes are lost — the user's interactive shell still has the old PATH,
so `nemoclaw` and `node` are both "command not found".

Additionally, `onboard.js` called the full `scripts/install.sh` just to
install openshell, which unnecessarily reinstalled Node, Docker, and
nemoclaw in a nested subprocess — compounding the PATH issue.

Changes:

scripts/install.sh:
- Add ensure_nvm_loaded() and refresh_path() to update PATH after
  npm installs nemoclaw
- Add nvm fallback detection for $HOME/.nvm when NVM_DIR is unset
- Soften verification: warn with instructions instead of hard-failing
  when the binary exists but isn't on PATH (exit 0, not exit 1)
- Add post-install message telling nvm/fnm users to `source ~/.bashrc`
- Use sudo for npm install -g when NODE_MGR=nodesource

install.sh (root):
- Soften verify_nemoclaw() to return 0 when binary exists but PATH
  is stale (was hard error via error())
- Add post_install_message() for shell reload instructions

bin/lib/onboard.js:
- Switch installOpenshell() to use dedicated install-openshell.sh
  instead of the full scripts/install.sh

scripts/install-openshell.sh (new):
- Dedicated openshell-only installer with macOS + Linux support
  and conditional sudo

Tested: 58/58 unit tests pass, 24/24 E2E tests pass (see PR NVIDIA#226).
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The installation process does not reload bash

3 participants