Skip to content

fix: verify nemoclaw is on PATH after install#70

Merged
jacobtomlinson merged 2 commits into
mainfrom
fix/install-path-verification
Mar 17, 2026
Merged

fix: verify nemoclaw is on PATH after install#70
jacobtomlinson merged 2 commits into
mainfrom
fix/install-path-verification

Conversation

@ericksoa

@ericksoa ericksoa commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #9./install.sh reported success but left nemoclaw unavailable on PATH, causing command not found after a clean install.

Root cause: When nvm installs Node.js, the npm global bin directory isn't always on PATH in the current shell session. npm link and npm install -g put the binary in the right place, but the shell can't find it. The installer never checked.

Changes to install.sh:

What Before After
nvm sourcing Inline \. "$HOME/.nvm/nvm.sh" (fragile) ensure_nvm_loaded() helper that sets NVM_DIR and sources reliably
PATH refresh None refresh_path() discovers npm global bin via npm config get prefix and adds it to PATH if missing
Post-install verification None — always reported success verify_nemoclaw() checks command -v nemoclaw, diagnoses the failure, prints actionable remediation steps, exits non-zero
Onboard command npx nemoclaw onboard (workaround) nemoclaw onboard (proves the command actually works)

Failure output example (when npm bin isn't on PATH):

[WARN]  nemoclaw is not on PATH after installation.
[WARN]  Found nemoclaw at /home/user/.nvm/versions/node/v24.0.0/bin/nemoclaw but that directory is not on PATH.
[WARN]
[WARN]  Add it to your shell profile:
[WARN]    echo 'export PATH="/home/user/.nvm/versions/node/v24.0.0/bin:$PATH"' >> ~/.bashrc
[WARN]    source ~/.bashrc
[WARN]
[WARN]  Or for zsh:
[WARN]    echo 'export PATH="/home/user/.nvm/versions/node/v24.0.0/bin:$PATH"' >> ~/.zshrc
[WARN]    source ~/.zshrc
[ERROR] Installation failed: nemoclaw --help could not be executed.

Acceptance criteria from #9

  • ./install.sh verifies that the nemoclaw executable is installed and discoverable on PATH
  • If installation depends on nvm, the installer handles that explicitly or fails with a clear remediation message
  • The installer exits non-zero if nemoclaw --help cannot be executed after install
  • No longer requires npx nemoclaw as a workaround — uses nemoclaw directly

Test results

All 8 test cases passed in Docker containers.

# Scenario Assertions Result
1 Fresh install via nvm (ubuntu:24.04, no prior Node.js) 5 PASS
2 Node.js already installed (node:22-slim, no nvm) 5 PASS
3 Install from source (cloned repo, npm link path) 4 PASS
4 Verification fails — binary exists but not on PATH 2 PASS
5 Verification fails — binary doesn't exist at all 2 PASS
6 No npx in script, onboard uses nemoclaw directly 2 PASS
7 ensure_nvm_loaded is idempotent (no PATH dupes) 3 PASS
8 refresh_path doesn't duplicate PATH entries 1 PASS

Total: 24 assertions, 0 failures

Key validations:

  • TC1: The primary bug — nvm installs Node, nemoclaw ends up on PATH without manual intervention
  • TC4-5: Error messages differentiate "binary exists but off PATH" (with shell-specific remediation) vs "binary missing entirely" (suggests npm install -g)
  • TC6: No npx workarounds — nemoclaw onboard is called directly, proving the command works
  • TC7-8: PATH manipulation is idempotent, no duplicate entries

ericksoa and others added 2 commits March 16, 2026 20:18
The installer reported success even when nemoclaw wasn't discoverable on
PATH, leaving users with "command not found" after a seemingly clean
install. Common cause: nvm installs Node.js but the npm global bin
directory isn't on PATH in the current shell session.

Changes:
- Add ensure_nvm_loaded() to reliably source nvm in the current shell
- Add refresh_path() to discover and add npm global bin to PATH
- Add verify_nemoclaw() that checks the command is callable, and if not,
  diagnoses the problem and prints actionable remediation steps
- Replace `npx nemoclaw onboard` with `nemoclaw onboard` so the onboard
  step itself proves the command works
- Exit non-zero if nemoclaw --help cannot be executed after install

Closes #9

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ntime check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@jacobtomlinson jacobtomlinson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Confirm nemoclaw is on the path for me after install.

@jacobtomlinson jacobtomlinson merged commit 6a6fb1e into main Mar 17, 2026
@jacobtomlinson jacobtomlinson deleted the fix/install-path-verification branch March 17, 2026 01:25
jessesanford pushed a commit to jessesanford/NemoClaw that referenced this pull request Mar 24, 2026
The installer reported success even when nemoclaw wasn't discoverable on
PATH, leaving users with "command not found" after a seemingly clean
install. Common cause: nvm installs Node.js but the npm global bin
directory isn't on PATH in the current shell session.

Changes:
- Add ensure_nvm_loaded() to reliably source nvm in the current shell
- Add refresh_path() to discover and add npm global bin to PATH
- Add verify_nemoclaw() that checks the command is callable, and if not,
  diagnoses the problem and prints actionable remediation steps
- Replace `npx nemoclaw onboard` with `nemoclaw onboard` so the onboard
  step itself proves the command works
- Exit non-zero if nemoclaw --help cannot be executed after install

Closes NVIDIA#9

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Jacob Tomlinson <jtomlinson@nvidia.com>
mafueee pushed a commit to mafueee/NemoClaw that referenced this pull request Mar 28, 2026
@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.

install.sh does not leave the nemoclaw CLI available on PATH

3 participants