audit-ci: Error: Invalid JSON (Unexpected " " at position 4 in state STOP)
Due to: https://github.com/IBM/audit-ci/issues/96
Yarn audit report results:
events.js:167
throw er; // Unhandled 'error' event
^
Error: Invalid JSON (Unexpected " " at position 4 in state STOP)
(It’s visible here: https://travis-ci.org/sumup/circuit-ui/jobs/559411807)
Related: #102
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 3
- Comments: 27 (10 by maintainers)
Commits related to this issue
- fix(repo): disabling audi-ci step until the package is fixed https://github.com/IBM/audit-ci/issues/103 — committed to dw2/chop-lines by dw2 4 years ago
We were running into the same problem as described in the first post of this issue. After some debugging, I found out that the string in the buffer where the JSON decoding fails is
<--- Last few GCs --->. Kinda strange, I was not expecting this string. Anyway, I’ve upped our--max_old_space_sizeand can now run audit-ci without issues.The side effect of this change is that this process now has a significant memory footprint.
same issue here if I use version 2.5.1.
if I revert to 2.1.0, another error 😂
@quinnturner I see the same problem with
--json:I tried looking into it a bit, but didn’t get too far. I only see why the error is thrown here: https://github.com/creationix/jsonparse/blob/master/jsonparse.js#L266
The problem is, that
this.stringis<---and of course, this is not a number.And I also found out, that
--report-type fulldid print theauditAdvisorys JSON. But then I didn’t find where the error really happened after that. Thisthenfor example was never called: https://github.com/IBM/audit-ci/blob/master/lib/yarn-auditer.js#L159-L169We’re still running into this with the latest version 2.3.0:
Any clues what’s going on?
we encountered this problem, turns out the CI environment we’re running in (travis) was using npm 5.6.0 which didn’t support
audityet and was causing misleading JSON error. Forcing the correct npm version resolved the problem for us.