I was having an issue with np on npm version 10.5.0 and when digging into it I found that the npm 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.
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
: