Cursor Agent Terminal Using Wrong pnpm Store Version

Bug Report: Cursor Agent Terminal Using Wrong pnpm Store Version

Issue Description

When using the Cursor AI agent to run pnpm commands in a project directory, the agent is attempting to use a different pnpm store version (v3) than what the project is using (v10), resulting in installation failures.

Steps to Reproduce

  1. Have a Next.js project that uses pnpm with store v10

  2. Ask the Cursor AI agent to install a Shadcn UI component

  3. Agent attempts to run: pnpm dlx shadcn@latest add command

  4. Command fails with store version mismatch error

Error Message

:check_mark: Checking registry.
⠹ Installing dependencies.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: pnpm add cmdk@1.0.0 @radix-ui/react-dialog
ERR_PNPM_UNEXPECTED_STORE Unexpected store location

The dependencies at “/path/to/project/node_modules” are currently
linked from the store at “/Library/pnpm/store/v10”.

pnpm now wants to use the store at “/Library/pnpm/store/v3” to link dependencies.

If you want to use the new store location, reinstall your dependencies with “pnpm install”.

You may change the global store location by running “pnpm config set store-dir --global”.
(This error may happen if the node_modules was installed with a different major version of pnpm)

Expected Behavior

The Cursor AI agent should use the same pnpm store version that the project is already using, or at least respect the project’s existing pnpm configuration.

Actual Behavior

The agent attempts to use a different pnpm store version (v3) than what the project is configured to use (v10), resulting in installation errors.

Environment Details

  • macOS (latest version)

  • Cursor Editor (latest version)

  • Project using Next.js 15.2.1 with pnpm

  • Project’s pnpm is configured to use store v10

  • Agent tries to use pnpm store v3

Additional Context

Running the exact same command manually in the terminal works perfectly fine, confirming that this is specifically an issue with how the Cursor agent executes pnpm commands. The agent appears to be using a different pnpm execution context than the user’s shell.

Current Workaround

The workaround is to run pnpm installation commands manually rather than through the Cursor agent.