Handle 'vulnerabilities' of undefined
viane opened this issue · 4 comments
I'm trying to run with npm audit fix --production --only=prod --json | npm-audit-html
and got this error. I assume because the fix
done it job and output is missing that entry.
Suggest solution:
haven't look at the code but i believe something like
const vulnerabilities = data.metadata.vulnerabilities || []
and output will show a default message of no vulnerability found.
I'd like to do a PR for this quick fix.
Hey, thanks for the bug report! That fix probably will work. I'd love to accept a PR with a good fix!
Might also want to look into putting a vulnerabilities fixed section in the report.
@nprail Hello Noah, I'm so sorry for the late reply, was packed last month. I did looked at the problem deeper since the solution I offered is too simple. So based on what I tried last time, the npm audit --fix
will return a different sets of properties. I will start research/experiment bit more before I commit to submit a code change ( I think this will have the bug fix + feature support).