Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

npm 12 invalid abbreviated flag "--prod"

Aperta
#904 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
cli

Direzione di ricerca

Start from the jf audit entry point for npm dependency collection and trace how --dep-type prodOnly produces the npm ls --prod command. Reproduce the failure with npm 12.2.0 using the command shown, then verify that a production-only scan completes successfully without the invalid abbreviated flag.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Describe the bug

NPM 11 is the last major version steal supported abbreviated flag --prod
When I execute jf-audit with NPM 12 and --dep-type prodOnly, the option --prod is injected and throw exit
It works if the option --dep-type prodOnly is not included in the command line.

Current behavior
$ jf audit --npm --dep-type prodOnly --watches [xxx] --fail=false --format simple-json
08:34:10 [Info] ####### Starting jf audit Scan #######
08:34:10 [Info] Command flags: [--dep-type=prodOnly --fail=false --format=simple-json --npm=true --watches=xxx]
08:34:12 [Info] Detecting recursively targets for scan in current directory
08:34:14 [Info] Generating SBOM...
08:34:14 [Info] Calculating npm dependencies...
08:34:15 [Warn] error while running '/usr/local/bin/npm ls --prod --ignore-scripts --json --all --long': exit status 1
Exit prior to config file resolving
cause
Invalid abbreviated flag "--prod". Did you mean "--production"?
08:34:15 [Info] Used npm version: 12.2.0
Reproduction steps

With NPM 12
$ jf audit --npm --dep-type prodOnly --watches [xxx] --fail=false --format simple-json

Expected behavior

The ability to scan only production dependencies

No response

JFrog CLI-Security version

?

JFrog CLI version (if applicable)

2.125.0

Operating system type and version

alpine 3.23

JFrog Xray version

No response

Lingua principale
Go
Stelle
13
Fork
52
Merge medio
2g 11h
PR unite (30g)
22

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jfrog/jfrog-cli-security

Tutte le issue di jfrog/jfrog-cli-security

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.