Can not run npm script

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

zsh:1: command not found: yarn

Steps to Reproduce

When I click “Run script” in context menu, in terminal script try to run with yarn instead of npm.

Expected Behavior

Always use npm!

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.75
VSCode Version: 1.99.3
Commit: 9e7a27b76730ca7fe4aecaeafc58bac1e2c82120
Date: 2025-11-12T17:34:21.472Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 24.6.0

Does this stop you from using Cursor

Yes - Cursor is unusable

**Hey, thanks for the report. Cursor/VS Code auto-detects the package manager based on lock files in your project (e.g., yarn.lock).

To force npm:

  • Cmd+, to open Settings
  • Search for npm.packageManager
  • Set it to “npm”

Or add to .vscode/settings.json:

{
    "npm.packageManager": "npm"
}

If you have a yarn.lock but want to use npm, delete yarn.lock and run npm install to create package-lock.json.

Let me know if this helps!

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