Bug report: NPM task detection fails to parse valid package.json

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor’s NPM task detection reports “failed to parse the file …/package.json” for files that are valid JSON and parse correctly in Node and other tools. The issue is reproducible with a minimal package.json and appears to be triggered by format (e.g. minified/single-line).

Steps to Reproduce

Create a new folder and add a valid, minified package.json (single line, no indentation), for example:
{“name”:“test-app”,“version”:“1.0.0”,“scripts”:{“start”:“node index.js”,“build”:“echo done”}}
Open that folder in Cursor.
Trigger NPM task detection (e.g. Run and Debug, Tasks panel, or NPM Scripts).
Observe: “Npm task detection: failed to parse the file …/package.json”.

Expected Behavior

Any valid JSON package.json (per spec and JSON.parse) should be accepted, including:
Minified (single-line) files
Pretty-printed (indented) files
Scripts should be detected and offered as runnable tasks.

Operating System

Linux

Version Information

Version: 2.4.28
VSCode Version: 1.105.1
Commit: f3f5cec40024283013878b50c4f9be4002e0b580
Date: 2026-02-03T00:56:18.293Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Linux x64 6.5.0-14-generic

Additional Information

This does not happen with VS Code, only cursor.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @LeilaSchooley

I tried it out and it works fine for me. The only thing to note is that when I copied your example, it had smart/curly quotes instead of straight quotes, which broke things.

How does this work for you?

{"name":"test-app","version":"1.0.0","scripts":{"start":"node index.js","build":"echo done"}}

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