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

Recommended "--omit=dev" option not found for NPM 8 #81

Closed
NLRemco opened this issue Jul 13, 2022 · 3 comments
Closed

Recommended "--omit=dev" option not found for NPM 8 #81

NLRemco opened this issue Jul 13, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@NLRemco
Copy link

NLRemco commented Jul 13, 2022

Description
When using NPM version >= 8 the --omit=dev option is not passed through.

Running the command better-npm-audit audit -p results in a warning by NPM advising you to use --omit=dev instead.

$ better-npm-audit audit -p
npm
 WARN config production Use `--omit=dev` instead.

However, when running said command better-npm-audit audit --omit=dev an error is spat out:

$ better-npm-audit audit --omit=dev
error: unknown option '--omit=dev'

Adding the option to better-npm-audit might be beneficial as currently it's producing warnings, but keeping the other option in for older NPM versions. Another solution could be to forward the -p option to execute --omit=dev for NPM 8.

Running npm audit --omit=dev works like a charm.

Context
NPM version: 8.13.2
Node version: v16.15.1
Better NPM Audit version (through NPM): 3.7.3
Architecture: Aarch64

@Zenulous
Copy link

I was on NPM 8.5.0 and did not receive this warning. Upgraded to 8.13.2 and now I get it as well. Seems to be a new warning (nowadays the --omit=dev flag is preferred over --production for the npm audit command)

@jens-duttke
Copy link

The pull request for this has been open for over a year. Is this project still being developed? Can anyone recommend alternatives?

@jeemok
Copy link
Owner

jeemok commented Aug 17, 2024

Sorry for the delay, have pushed these changes into master and will release a new version soon. Thanks again to Eric for contributing to this!

@jeemok jeemok closed this as completed Aug 17, 2024
@jeemok jeemok self-assigned this Aug 17, 2024
@jeemok jeemok added the enhancement New feature or request label Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants