From 6bd05a2c414c9a9da5f9fb4e79557a86447afce8 Mon Sep 17 00:00:00 2001 From: Aaron Erickson Date: Mon, 16 Mar 2026 15:07:52 -0400 Subject: [PATCH] fix: ensure nemoclaw CLI is on PATH after nvm-based install After install.sh installs Node via nvm, npm global bins land in a non-standard directory that isn't on PATH. This adds the npm global bin dir to PATH immediately and persists it to .bashrc/.zshrc so nemoclaw works in the current session and future shells. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Aaron Erickson --- install.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/install.sh b/install.sh index ff7dd226e3b..0b3acd97ec1 100755 --- a/install.sh +++ b/install.sh @@ -120,6 +120,13 @@ install_or_upgrade_ollama() { # 3. NemoClaw # --------------------------------------------------------------------------- install_nemoclaw() { + # Ensure npm global bin is on PATH (nvm installs to a non-standard location) + local npm_bin + npm_bin="$(npm config get prefix)/bin" + if ! echo "$PATH" | tr ':' '\n' | grep -qx "$npm_bin"; then + export PATH="$npm_bin:$PATH" + fi + if [[ -f "./package.json" ]] && grep -q '"name": "nemoclaw"' ./package.json 2>/dev/null; then info "NemoClaw package.json found in current directory — installing from source…" npm install && npm link @@ -127,6 +134,19 @@ install_nemoclaw() { info "Installing NemoClaw from npm…" npm install -g nemoclaw fi + + # Persist npm global bin for future shells + local profile="$HOME/.bashrc" + [ -f "$HOME/.zshrc" ] && profile="$HOME/.zshrc" + if ! grep -q 'npm config get prefix' "$profile" 2>/dev/null; then + echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> "$profile" + info "Added npm global bin to $profile" + fi + + if ! command_exists nemoclaw; then + error "nemoclaw not found in PATH after install. Try: source ~/.bashrc && nemoclaw --help" + fi + info "nemoclaw is ready: $(nemoclaw --version 2>/dev/null || echo 'installed')" } # ---------------------------------------------------------------------------