Agent shell injects `npm_config_devdir`, causing npm 11 warning on macOS

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

  1. Open any project in Cursor IDE.

  2. Ask the Agent to run:

    npm config get userconfig

  3. Observe the npm warning about the unknown devdir configuration.

  4. Ask the Agent to run:

    printenv npm_config_devdir

  5. Observe that it points to:

    /var/folders/…/cursor-sandbox-cache/…/node-gyp

  6. 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:

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

Hey @watson thanks for the clean repro. You’ve got it right, and it’s not anything on your end. It’s a warning only, npm runs normally, and the env -u npm_config_devdir npm ... you found is the safe way to silence it (or you can just ignore it). We’ve let the team know and it’s an issue we’re tracking. I’ll post here when there’s an update.

Thanks for your quick reply. Yes, I know it’s safe to just ignore it, but anything that fills up the context window like this, I would love to get rid of :wink: