Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,33 @@ 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
else
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')"
}

# ---------------------------------------------------------------------------
Expand Down