# Cursor Agent Terminal: spawn EPERM on Windows

**URL:** <https://forum.cursor.com/t/cursor-agent-terminal-spawn-eperm-on-windows/150268>\
**Category:** Bug Reports\
**Tags:** terminal, sandbox, windows\
**Created:** [January 29, 2026, 10:58am UTC](https://forum.cursor.com/t/cursor-agent-terminal-spawn-eperm-on-windows/150268 "2026-01-29T10:58:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Corringham](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@Tim\_Corringham](https://forum.cursor.com/u/Tim_Corringham)\
**Post date:** [January 29, 2026, 10:58am UTC](https://forum.cursor.com/t/cursor-agent-terminal-spawn-eperm-on-windows/150268/1 "2026-01-29T10:58:37Z")

</div>

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

Cursor IDE

### Describe the Bug

The Cursor AI agent terminal on Windows cannot spawn child processes (e.g. esbuild, node.exe) when running commands like `npm run test`, resulting in `spawn EPERM` errors. The same commands work perfectly in a normal terminal.

The issue seems to be Cursor’s agent terminal sandbox on Windows blocking child processes spawning.

### Steps to Reproduce

Ask agent to run terminal command from a Windows machine. See error output in terminal.

### Expected Behavior

Agent is able to run terminal commands on Windows machines.

### Operating System

Windows 10/11

### Version Information

Version: 2.4.22 (system setup)  
VSCode Version: 1.105.1  
Commit: 618c607a249dd7fd2ffc662c6531143833bebd40  
Date: 2026-01-26T22:51:47.692Z  
Build Type: Stable  
Release Track: Default  
Electron: 39.2.7  
Chromium: 142.0.7444.235  
Node.js: 22.21.1  
V8: 14.2.231.21-electron.0  
OS: Windows\_NT x64 10.0.26200

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [January 30, 2026, 7:29am UTC](https://forum.cursor.com/t/cursor-agent-terminal-spawn-eperm-on-windows/150268/3 "2026-01-30T07:29:30Z")

</div>

Hey, thanks for the report. This looks like a Windows sandbox issue, there are a few similar reports.

Can you try this workaround: Legacy Terminal  
Cursor Settings \> Agents \> Terminal \> enable “Legacy Terminal Tool”

This will disable the sandbox, and the agent will use the regular terminal.

Also, for debugging it would help to know:

1. The full error log from the terminal
2. Are you using an antivirus or a corporate firewall?

I’ll pass this to the team.

---

<div class="post-metadata">

**Author:** ![Tim\_Corringham](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@Tim\_Corringham](https://forum.cursor.com/u/Tim_Corringham)\
**Post date:** [January 30, 2026, 9:09am UTC](https://forum.cursor.com/t/cursor-agent-terminal-spawn-eperm-on-windows/150268/4 "2026-01-30T09:09:47Z")

</div>

Hi Dean,

I use Surfshark AntiVirus but have added all node\_modules as exclusions, so this shouldn’t be blocking it. I also installed Powershell 7 and set it as the default, but that didn’t resolve the issue.

The full error is:

```auto
⎯⎯⎯⎯⎯⎯⎯ Startup Error ⎯⎯⎯⎯⎯⎯⎯⎯
Error: spawn EPERM
at ChildProcess.spawn (node:internal/child_process:420:11)
at Object.spawn (node:child_process:753:9)
at ensureServiceIsRunning ([FILE PATH]\node_modules\esbuild\lib\main.js:1978:29)
at build ([FILE PATH]\node_modules\esbuild\lib\main.js:1876:26)
at bundleConfigFile (file:///[FILE PATH]/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:49309:24)
at async bundleAndLoadConfigFile (file:///[FILE PATH]/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:49293:19)
at async loadConfigFromFile (file:///[FILE PATH]/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:49257:44)
at async resolveConfig (file:///[FILE PATH]/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:48752:24)
at async _createServer (file:///[FILE PATH]/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:38349:66)
at async createViteServer (file:///[FILE PATH]/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:6911:17) {
errno: -4048,
code: ‘EPERM’,
syscall: ‘spawn’
}

Get-ChildItem : An item with the same key has already been added.
At [FILE PATH]\AppData\Local\Temp\ps-script-fded9fe0-2501-42bd-868b-84af575fba92.ps1:31 char:16

$envVars = Get-ChildItem Env: | Sort-Object Name

           ~~~~~~~~~~~~~~~~~~

CategoryInfo : NotSpecified: (
 [Get-ChildItem], ArgumentException

FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.GetChildItemCommand

```

I have enabled Legacy Terminal Tool and this seems to have resolved the issue, thanks.

Tim

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/127254_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [February 21, 2026, 9:10am UTC](https://forum.cursor.com/t/cursor-agent-terminal-spawn-eperm-on-windows/150268/5 "2026-02-21T09:10:33Z")

</div>

Closed on February 21, 2026, 9:10am UTC

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