fix: resolve PATH issues after nvm installs Node.js#228
Conversation
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).
|
Reproduced the issue on 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:
|
liveaverage
left a comment
There was a problem hiding this comment.
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
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).
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).
Summary
Fixes #205. After
curl -fsSL https://nvidia.com/nemoclaw.sh | bashinstalls Node.js via nvm, the parent shell doesn't have the updated PATH. Bothnemoclawandnodeare "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.jscalled the fullscripts/install.shto install openshell, which unnecessarily reinstalled Node, Docker, and nemoclaw in a nested subprocess — compounding the PATH issue.Changes
scripts/install.sh:ensure_nvm_loaded()andrefresh_path()to explicitly update PATH after npm installs nemoclaw$HOME/.nvmwhenNVM_DIRis not exported (common in Docker containers)source ~/.bashrcsudofornpm install -gwhenNODE_MGR=nodesource(system Node requires root for global installs)install.sh(root):verify_nemoclaw()to return 0 when the binary exists but PATH is stale (was a hard error)post_install_message()function with shell reload instructionsbin/lib/onboard.js:installOpenshell()to use dedicatedinstall-openshell.shinstead of the fullscripts/install.shscripts/install-openshell.sh(new):Test plan
node --test test/*.test.js)bash -n)install-openshell.shhandles both Darwin and Linux asset namesrefresh_path()uses POSIX-compatiblecasefor PATH dedup check