davityavryan / yarn-audit-html

Generate a HTML report for Yarn Audit
MIT License
29 stars 13 forks source link

Error when I trying create a report #28

Closed MrRefactoring closed 3 years ago

MrRefactoring commented 3 years ago

yarn audit --json returns 3.1 GB data. And when I executed yarn-audit-html I got an error:

<machine name>@<sesson> <project name> % yarn audit --json | yarn-audit-html
Checking audit logs...
/Users/<machine name>/.nvm/versions/node/v14.15.5/lib/node_modules/yarn/lib/cli.js:92452
  throw err;
  ^

Error: write ENOBUFS
    at afterWriteDispatched (internal/stream_base_commons.js:156:25)
    at writevGeneric (internal/stream_base_commons.js:139:3)
    at Socket._writeGeneric (net.js:783:11)
    at Socket._writev (net.js:792:8)
    at doWrite (internal/streams/writable.js:375:12)
    at clearBuffer (internal/streams/writable.js:521:5)
    at onwrite (internal/streams/writable.js:430:7)
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:103:10) {
  errno: -55,
  code: 'ENOBUFS',
  syscall: 'write'
}
Failed to generate report! Please report this issue to https://github.com/davityavryan/yarn-audit-html/issues
 TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at generateReport (/Users/<machine name>/.nvm/versions/node/v14.15.5/lib/node_modules/yarn-audit-html/lib/reporter.js:67:37)
    at Socket.<anonymous> (/Users/<machine name>/.nvm/versions/node/v14.15.5/lib/node_modules/yarn-audit-html/index.js:62:9)
    at Socket.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
davityavryan commented 3 years ago

Hey @MrRefactoring, Thanks for reporting it. can you please provide package.json and yarn.lock please. that would be helpful to debug the issue.

MrRefactoring commented 3 years ago

package.json + yarn.lock: data.zip

davityavryan commented 3 years ago

Thanks @MrRefactoring

Hmmm. seems like you have so many vulnerabilities that even stream buffer limit in Node is reached. :)

I don't have any way to fix this in my package as of I don't have control on that limit. But I have a solution that might help you to use my package without errors.

Try doing yarn audit --json > audit.json and then with separate command cat audit.json | yarn-audit-html. This will separate Buffer usages in Node between two commands so they will not reach the limit.

Here, you can find attached audit report for your repo.

yarn-audit.html.zip

Thanks again fro reporting this issue. ;) Feel free to close this issue if it resolves your problem.