Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Actual
In a sandboxed Agent shell on this machine (observed 2026-08-06):
PLAYWRIGHT_BROWSERS_PATH=C:\Users<user>\AppData\Local\Temp\cursor-sandbox-cache<hash>\playwright
npm_config_devdir=C:\Users<user>\AppData\Local\Temp\cursor-sandbox-cache<hash>\node-gyp
NPM_CONFIG_DEVDIR=C:\Users<user>\AppData\Local\Temp\cursor-sandbox-cache<hash>\node-gyp
Meanwhile the real browsers already exist and work:
%LOCALAPPDATA%\ms-playwright
chromium-1228
chromium_headless_shell-1228
firefox-1532
webkit-2311
…
Playwright then resolves executables under the empty sandbox path → Executable doesn’t exist → agents re-run playwright install every session even though Chromium is already installed on the host.
npm 11+ emits repeated:
npm warn Unknown env config “devdir”. This will stop working in the next major version of npm.
because Cursor sets npm_config_devdir=…\cursor-sandbox-cache...\node-gyp.
Impact
Wasteful Playwright Chromium re-downloads in Agent sessions (hundreds of MB, minutes of friction)
Agents incorrectly conclude “browsers missing” and burn tokens reinstalling
Noisy npm warnings on nearly every Agent npm/npx invocation
Repo workarounds that sniff cursor-sandbox-cache would couple product code to Cursor internals (we intentionally avoid that)
Suggested fix
Do not override PLAYWRIGHT_BROWSERS_PATH unless the sandbox path is provisioned with the required browser builds — or fall back to the OS default cache when the sandbox dir is empty/missing.
For node-gyp caching, set a node-gyp-specific env var (e.g. whatever node-gyp actually reads), not npm_config_devdir / NPM_CONFIG_DEVDIR, so npm does not treat it as an npm config key.
Ideally: if the host cache already contains the needed Playwright revision, reuse it (read-only) instead of forcing a second install tree under %TEMP%\cursor-sandbox-cache.
Notes
This matches reports on Linux/WSL where Agent sets PLAYWRIGHT_BROWSERS_PATH=/tmp/cursor-sandbox-cache/…/playwright while browsers live in ~/.cache/ms-playwright.
Host terminal outside sandbox: browsers resolve correctly; problem is specific to Agent sandbox env injection.
Steps to Reproduce
On Windows, install Playwright Chromium once into the normal host cache:
%LOCALAPPDATA%\ms-playwright\ (e.g. chromium-1228 present and working outside the Agent)
In Cursor Agent chat, ask the agent to run a shell command that prints:
$env:PLAYWRIGHT_BROWSERS_PATH
$env:npm_config_devdir
whether %LOCALAPPDATA%\ms-playwright exists
Ask the agent to run Playwright E2E / npx playwright test (or inspect chromium.executablePath()).
Separately run npm --version / npm config list in an Agent shell and observe npm warnings about devdir.
Expected Behavior
Agent shells should either:
reuse the existing user Playwright browser cache, or
pre-populate the sandbox Playwright cache when overriding PLAYWRIGHT_BROWSERS_PATH
npm_config_devdir should not be injected as an npm config key. devdir is a node-gyp option; npm 11+ treats unknown npm_config_* keys as warnings (Unknown env config “devdir”).
Operating System
Windows 10/11
Version Information
Cursor version: 3.14.27 (Windows 10/11, win32 10.0.26200)
Area: Agent / sandboxed shell (local Agent tool calls), not Cloud Agent specifically
Repro: any Agent shell command that reads env or runs Playwright / npm
Does this stop you from using Cursor
No - Cursor works, but with this issue