Agent shell uses stale Node version vs active terminal. My project uses a dev container with node v24.14.0 with Astro 6.1.8 which requires node >=22.12.0.
Steps to Reproduce
Repro:
Interactive terminal is on Node v24.14.0
Agent runs node -v and gets v20.18.2
Agent build fails with Astro Node requirement error (>=22.12.0)
The agent offers misleading, potentially corrupting commands:
Verification attempt:
pnpm -F web build failed due to local Node version mismatch, not code errors:
Astro requires >=22.12.0
Current environment is v20.18.2
What to run on your machine to validate end-to-end:
Upgrade/switch Node to >=22.12.0
Start normally (without force): pnpm turbo run dev
Hard refresh once and confirm the hydration error is gone
Hey, thanks for the detailed report. This is a known issue. cursor-server prepends its bundled Node v20.18.2 to PATH, and the agent shell inherits that env. The interactive terminal in the devcontainer resolves the environment later, so it picks up the correct Node version. The symptom is exactly the same as in this Remote SSH thread: cursor-server locked to Node.js 20.18.2 breaking odoo and all extensions requiring node js 22 ! Cursor Remote SSH regression: cursor-server locked to Node.js 20.18.2, breaking Odoo and all extensions requiring Node.js 22+
We’re tracking this on our side, but I can’t share an ETA yet. When there’s an update, I’ll post it here.
As a workaround for now, any of these should help:
Add nvm use 24 (or the equivalent for fnm or mise) to ~/.bashrc or ~/.zshrc inside the container. This runs after the prepend and will override PATH to the right Node.
In devcontainer.json, add "remoteEnv": { "PATH": "/path/to/node24/bin:${containerEnv:PATH}" } to explicitly set the priority.
Or use a symlink /usr/local/bin/node → Node 24, so the cursor-server prepended binary won’t win priority. It lives in a different path, but please double-check with which node.
Let me know if none of this works in your setup and I’ll suggest what else to check.
So this is not a PATH, shell, or Ubuntu issue — Cursor Remote SSH is forcibly using its bundled Node 20.18.2 runtime.
Because of that:
nvm use
.bashrc
remoteEnv
system node symlinks
do not change the actual extension host runtime.
The real fix requires updating or overriding the bundled ~/.cursor-server/.../node binary itself. Otherwise Cursor will continue running the remote extension host on Node 20.18.2 regardless of PATH configuration.
Thanks Alex, spot-on reply. The workarounds Dean suggests do not solve the problem.
Hope the Cursor team make this a priority as it’ll cause problems for anyone developing with Astrojs v6.1.x as it requires node v22+ as well as Oodo and other tools. As more apps require newer node versions, the Cursor agent will fail them and offer misleading, potentially damaging instructions.