Fix json output in some npm version #737
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was having an issue with
np
onnpm
version10.5.0
and when digging into it I found that thenpm pack
command was outputting some "helpful" notes prior to the JSON.I tried adding a
--silent
to the command, and that fixed remove the "helpfulness".Apart from doing that, this PR also wraps the original exception in a new error that explains what kind of JSON-parsing that's failing – as that can make it a bit more easy to understand why it suddenly started failing.
My
npm
version10.5.0
: