Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When running npm search <search term> --json, the output can include invalid json that cannot be parsed using JSON.parse
Expected Behavior
When running npm search <search term> --json, the output should include valid json that can be parsed using JSON.parse
Steps To Reproduce
- Run
npm search @khanacademy/wonder-blocks --json --searchlimit=1000
- Notice that the output includes invalid json:
> npm search @khanacademy/wonder-blocks --json --searchlimit=1000
[
...,
{
"name":"@automattic/newspack-blocks",
// ... other fields
"sanitized_name":***@automattic/newspack-blocks" // missing quotation between the : and ***
},
...,
]
Environment
- npm: 11.11.0
- Node.js: 24.13.1
- OS Name: Tahoe 26.3.1
- System Model Name: Macbook Pro
- npm config:
; "user" config from /Users/beaesguerra/.npmrc
@khan:registry = "https://npm.pkg.github.com"
//npm.pkg.github.com/:_authToken = (protected)
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When running
npm search <search term> --json, the output can include invalid json that cannot be parsed usingJSON.parseExpected Behavior
When running
npm search <search term> --json, the output should include valid json that can be parsed usingJSON.parseSteps To Reproduce
npm search @khanacademy/wonder-blocks --json --searchlimit=1000Environment