# CLI agent prepends bundled Node onto PATH

**URL:** <https://forum.cursor.com/t/cli-agent-prepends-bundled-node-onto-path/168848>\
**Category:** Bug Reports\
**Tags:** terminal, cli\
**Created:** [August 19, 2026, 11:05am UTC](https://forum.cursor.com/t/cli-agent-prepends-bundled-node-onto-path/168848 "2026-08-19T11:05:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikael\_ham](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@mikael\_ham](https://forum.cursor.com/u/mikael_ham)\
**Post date:** [August 19, 2026, 11:05am UTC](https://forum.cursor.com/t/cli-agent-prepends-bundled-node-onto-path/168848/1 "2026-08-19T11:05:05Z")

</div>

### Where does the bug appear (feature/product)?

Cursor CLI

### Describe the Bug

Agent shells prepend the CLI runtime dir (`~/.local/share/cursor-agent/versions/<build>/`) to PATH. That directory contains Cursor’s bundled `node`, so it wins over whatever Node is installed locally or pinned by the project.

Same PATH-prepend class as [161653](https://forum.cursor.com/t/when-agent-checks-node-version-it-outputs-its-own-sandboxed-version/161653) (marked rolled out for IDE/cursor-server). Still happens for the **CLI runtime**.

### Steps to Reproduce

1. Install/pin a project Node that is not Cursor’s bundled version.
2. In a normal terminal, which node / node -v show that install.
3. In an Agent/CLI tool shell:

```auto
   1 │which -a node
   2 │node -v

```

First hit is `~/.local/share/cursor-agent/versions/2026.08.11-e8db854/node` (here: v24.5.0), not the project Node.

### Expected Behavior

Bundled Node is only for running the agent. Project commands should resolve node the same way an interactive terminal does.

### Screenshots / Screen Recordings

 ![Screenshot 2026-08-19 at 14.02.00.png](https://us1.discourse-cdn.com/cursor1/original/3X/9/2/927c12f31b008ca72a73903bee53f7a75c8ad1f0.png) ![Screenshot 2026-08-19 at 14.04.15.png](https://us1.discourse-cdn.com/cursor1/original/3X/6/b/6bc29f0f0ac3ee3f6bc559d784f026dfcc7f1617.png)

### Operating System

MacOS

### Version Information

cursor-agent 2026.08.11-e8db854  
bundled Node v24.5.0  
locally installed Node v24.18.0  
macOS 26.6 (Tahoe)

### Additional Information

IDE Agent tool shells inherit this PATH too; the binary is the CLI install, not cursor-server. Related: [162819](https://forum.cursor.com/t/agent-shells-resolve-node-to-cursors-bundled-node-instead-of-the-system-nvm-node-already-on-path/162819).

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<div class="post-metadata">

**Author:** ![Colin](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/colin/32/90452_2.png) [@Colin](https://forum.cursor.com/u/Colin)\
**Post date:** [August 19, 2026, 12:05pm UTC](https://forum.cursor.com/t/cli-agent-prepends-bundled-node-onto-path/168848/5 "2026-08-19T12:05:11Z")

</div>

Hey `@mikael_ham`! Thanks for reporting this.

There is a real issue here (it’s weird that the node install from the agent ends up in the PATH). I’ll flag that for the team.

In the meantime, could you try adding this to your local `.zshrc` file?

```auto
export PATH="$HOME/.local/share/mise/shims:$PATH"

```

CLI agent shells are `zsh -ilc`, so they source `~/.zshrc`. With a new CLI agent shell, `which -a node` should now list the mise shim first, and `node -v` should be your v24.18.0. The `cursor-agent/versions/.../node` line can still appear, just not first.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [September 25, 2026, 10:15am UTC](https://forum.cursor.com/t/cli-agent-prepends-bundled-node-onto-path/168848/8 "2026-09-25T10:15:33Z")

</div>

Closed on September 25, 2026, 10:15am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
