Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Cursor’s sandboxed Agent shell injects npm_config_devdir with a path under cursor-sandbox-cache. npm 11 treats devdir as an unsupported npm configuration key and emits this warning:
npm warn Unknown env config “devdir”. This will stop working in the next major version of npm.
Neither my project nor user .npmrc defines devdir.
Steps to Reproduce
-
Open any project in Cursor IDE.
-
Ask the Agent to run:
npm config get userconfig
-
Observe the npm warning about the unknown
devdirconfiguration. -
Ask the Agent to run:
printenv npm_config_devdir
-
Observe that it points to:
/var/folders/…/cursor-sandbox-cache/…/node-gyp
-
Compare with:
env -u npm_config_devdir npm config get userconfig
The command runs without the warning when the injected variable is removed.
Expected Behavior
Cursor’s Agent shell should not inject an unsupported npm configuration key. npm commands should run without the Unknown env config "devdir" warning, while node-gyp cache isolation continues to work through a supported mechanism.
Operating System
MacOS
Version Information
Version: 3.19.13 (Universal)
VS Code Extension API: 1.128.0
Commit: dd066f332fcea7382764400fde902f61920648d0
Date: 2026-09-04T17:41:16.065Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 25.6.0
For AI issues: which model did you use?
GPT-5.6 Sol
This appears to be an Agent shell infrastructure issue and is likely independent of the selected model.
Additional Information
Environment:
- Cursor 3.19.13
- macOS 26.6.2
- Node.js 24.14.1
- npm 11.19.1
Related reports:
- Agent sandbox redirects PLAYWRIGHT_BROWSERS_PATH and npm_config_devdir to empty cursor-sandbox-cache (Windows) — Playwright reinstall loops + npm 11 warnings
- Shell Tool Injects 30+ Sandbox Cache Environment Variables Even with required_permissions: ["all"], Breaking Build Tools
Both related reports were automatically closed without a posted fix. This remains reproducible as of September 6, 2026.
Does this stop you from using Cursor
No - Cursor works, but with this issue