I have a number of projects on the go on one machine. If I have multiple cursor windows open, nvm use will not work.
If I close all the other windows and then just use the one I want, it will respect the command for a while and then just not do it until a reboot.
My terminal is setup with omz. Everything works fine with iTerm.
Am I just better off using iterm for everything and ignoring the Cursor terminal?
Hi Nikesh!
This is a known limitation of how Cursor’s integrated terminal handles the shell environment. When Cursor starts, it resolves the shell environment once and caches it for the session. With multiple windows open, all windows share that same cached environment, which can cause nvm use to not take effect as expected.
A few things to try:
- Auto-load nvm per directory – add this to your
.zshrc so nvm activates automatically whenever you cd into a project with a .nvmrc:
autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
-
Disable environment inheritance – set terminal.integrated.inheritEnv to false in Cursor Settings (JSON). This forces each new terminal to start with a clean environment and source your shell config fresh, rather than inheriting the cached one. This is the most likely fix for the multi-window issue.
-
Launch Cursor from the terminal – if you open Cursor via cursor . from a terminal where nvm is already set to the right version, the initial cached environment will have the correct Node version.
For now, option 2 is probably the best bet for your multi-project workflow. Let me know if any of these help.
I’ve done all 3 of these and still no luck. See screenshot of the .nvmrc file created, nvm use command and then node —version showing a different version.
Thanks for the detailed screenshot. The fact that nvm use says “Now using node v22.22.2” but node --version still returns v25.9.0 means something is preventing the PATH change from taking effect. To pinpoint the cause, could you run these commands right after nvm use and share the output?
which node
type -a node
echo $PATH | tr ':' '\n' | head -20
This will show us exactly where the v25.9.0 binary lives and whether it’s ahead of nvm’s managed directory in your PATH. It’ll also reveal if there’s an alias or function named node that’s bypassing PATH entirely.