[BUG] npm list --json produces invalid json when --silent is included #2163
Labels
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 7.x
work is associated with a specific npm 7 release
Milestone
Current Behavior:
In a situation where an error occurs but is suppressed by the
--silent
flag when runningnpm list --json
, the resulting json output is invalid.For example, the resulting json can look like this:
These are two json objects in succession without a valid separator, trying to run e.g.
JSON.parse()
on it will fail since it is invalid.Expected Behavior:
The resulting output should only contain the result of
npm list --json
, and that result should be valid json.Steps To Reproduce:
Environment:
Note that this most likely applies to npm 6 as well.
The text was updated successfully, but these errors were encountered: