Cursor use embedded node instead of system default

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor is using embedded node instead of default, it prevents git pre-commit hooks rom running properly

Steps to Reproduce

  • install node on your machine and set it as default version (i.e. with evm and node 22)
  • verify it’s the current version by running node -v
    ❯ node -v
    v22.22.0
  • set up your engines in package.json to be >=22
  • use a pre-commit hook with husky with the following command:
    node -v
    which node
  • try to commit anything and see the gir error:
    v20.18.2
    /home/tonio/.cursor-server/bin/3dc559280adc5f931ade8e25c7b85393842acf30/node

Expected Behavior

cursor uses same version as terminal

Operating System

Windows 10/11

Version Information

Version: 3.3.30 (user setup)
VSCode Version: 1.105.1
Commit: 3dc559280adc5f931ade8e25c7b85393842acf30
Date: 2026-05-09T18:28:42.332Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, this is a known issue. On WSL and Remote SSH, cursor-server puts its bundled Node v20.18.2 at the front of PATH, and git hooks via husky pick that up instead of your system nvm or fnm Node. There are similar reports already:

We’re tracking this on our side, but I can’t share an exact fix date yet. As a workaround, you can explicitly call the Node you need in the hook, for example via the absolute path to your nvm version or npx --node-version=22, but that’s a workaround, not a real fix. I’ll post in the thread when we have an update on the fix.

I hit the same issue when committing from Cursor Source Control.

The Git hook reports:

Detected Node.js v20.18.2

This suggests Cursor’s Git commit flow is not using the integrated terminal shell environment. When clicking Commit in the Source Control panel, the Git hook appears to be launched by Cursor’s Git extension process, inheriting the environment from the Cursor desktop app startup, rather than the Node version selected later via nvm in the integrated terminal.

Expected: Git hooks launched from Cursor Source Control should respect the workspace/user shell Node environment, or at least provide a documented way to configure the Node used by hooks.

Hey, @YTY1, yep, it’s the same issue described in the thread above. The Source Control commit runs git hooks via an extension that inherits the cursor-server environment, with its bundled Node v20.18.2 at the start of PATH, so switching via nvm in the integrated terminal doesn’t get picked up.

We’re tracking this bug, but I can’t share an ETA for a fix yet. As a workaround, you can explicitly point the hook to the Node you need, either by using the absolute path to your nvm version or via npx --node-version=22. We’ll post an update in the thread once we have it.

If anyone’s using husky/nvm, here’s what worked for me on WSL: husky sources ~/.config/husky/init.sh before every hook, so you can force your nvm Node onto PATH there and beat cursor-server to it:

# ~/.config/husky/init.sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" >/dev/null 2>&1
NODE_BIN="$NVM_DIR/versions/node/$(nvm version default 2>/dev/null)/bin"
[ -d "$NODE_BIN" ] && export PATH="$NODE_BIN:$PATH"

Worth knowing: sourcing nvm.sh on its own won’t fix it, and nvm use default doesn’t either. Cursor-server’s bin still ends up earlier in PATH for some reason, so you have to prepend it yourself. The snippet follows whatever your nvm default is. If you want to pin a specific version, just hardcode the path on the NODE_BIN= line.

Hey @Anas thanks for the detailed snippet with ~/.config/husky/init.sh. It’s cleaner than what I suggested above, and it should work for most users on nvm. I’ll leave it here as a reference for anyone who comes across this thread.

As for the bug, we’re still tracking the issue on our side, and there’s no ETA for a fix yet. As soon as I have an update, I’ll reply here.

Hey folks, I can’t run any vscode task that requires Node LTS because of this nonsense. I don’t use cloud agents and don’t care about them, but you decided to put whatever is bundled with Cursor into PATH of EVERY task that can be triggered from the IDE. That’s poor engineering, please own it and fix it already. This is unacceptable.

Hey @goodov, this is a known bug and this thread is about it.

It’s not just cloud agents. In WSL and Remote SSH, cursor-server puts its bundled Node v20.18.2 at the front of PATH for anything launched via extensions like git hooks, tasks, and source control. The usual workarounds via server-env-setup, .bashrc, or nvm use don’t work because cursor-server prepends its bin again after those scripts run.

We’ve reported the issue internally. There’s no ETA for a fix yet, and we’ll post an update here as soon as we have one.

For now, as a workaround for tasks, you can either set an absolute path to the Node you want in the task definition, or use the same approach as @Anas in Post #9 which force-prepends your desired bin to the front of PATH in your shell init script. It’s not ideal, but it works until we ship a fix.

Hey all!

A fix for this should come in v3.7, which is right around the corner.

Is the fix coming? At the moment, any node script launched by an agent from the agent window is still hitting this problem, agents workaround is to use local npx and reinstall pnpm store

This is very slow and resource consuming, it starts to be blocking. I find myself returning back to TUI for agents, defeating the purpose of a tool like cursor.

Any real ETA would be appreciated

@Antoine_Codogno A fix should have landed in 3.7.5. If you’re using a newer version, could I suggest you raise a new bug report with all sections filled out including steps to reproduce? It will help us determine whether it’s the same issue.