Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm audit --only=prod is not ignoring dev dependency vulnerabilities #440

Closed
mportela opened this issue Dec 13, 2019 · 2 comments
Closed
Labels
feature-request New feature request

Comments

@mportela
Copy link
Contributor

In our huskyCI/api/config.yaml file the npm audit try to only analyse the prod dependency using the command:

npm audit --only=prod --json > /tmp/results.json 2> /tmp/errorNpmaudit

but this command stay reporting vulnerability from dev dependencies 😭 ...

reference: npm/cli#125

to solve this issue while they don`t have this fixed we could use an intermediate help script that parse the audit json result and generate a final result without the dev dependencies...

npm audit --json >> /tmp/audit_report.json
npm run audit:process

like this:
https://medium.com/@linzhao/npm-audit-with-travis-ci-d7acc3e2195a

** to reproduce the npm audit problem ignoring the only=prod :

mkdir test_audit
cd test_audit
npm init
npm i -D [email protected]
npm audit --only=prod

this will print dev dependencies vulnerabilities...

@rafaveira3 rafaveira3 added the feature-request New feature request label Dec 13, 2019
@rafaveira3
Copy link
Contributor

Hello, @mportela! That's great! Thanks for the feedback. We will work on this one soon!

@Krlier
Copy link
Contributor

Krlier commented Oct 7, 2020

This issue has been already covered and we have some documentation on how it can be fixed.

For any doubts, feel free to drop us a line and reopen this issue.

@Krlier Krlier closed this as completed Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request
Projects
None yet
Development

No branches or pull requests

3 participants