You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since this is happening again, I would like to suggest buffering output. The output OOMs because the path .data.advisory.findings[].paths gets as large as 20k elements, and each element is some 100+ characters. For example, yarn audit --json | grep '"auditAdvisory"' | jq -r .data will OOM after outputting the first line, and these are quite fast, streaming data processing utilities.
I would assume (I don't know) that using a size limited buffer of objects would be helpful. One iterator creates the JSON strings to be written and adds them to a size-limited FIFO queue. A writer pulls from the queue and writes them to the output (pipe, redirect, stdout, etc). This is more in line with out CLI utils generally work in *nix-land.
Bug description
Due to https://www.npmjs.com/advisories/1488 and https://www.npmjs.com/advisories/1490, running
yarn audit
on a midsized project will OOM and crash.Command
What is the current behavior?
Prior to those two advisories,
yarn audit
completed successfully.What is the expected behavior?
yarn audit
should not OOM because a commonly used package (that appears as a dep to many packages) has a vuln.Steps to Reproduce
Simply running
yarn audit
. I cannot provide a link to a public repo for this.Environment
v12.16.1
1.22.4
Linux localhost 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: