npm 12 invalid abbreviated flag "--prod"

Abierto
#904 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Go
Estrellas
13
Forks
53
Merge medio
3 d 2 h
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de jfrog/jfrog-cli-security

Todos los issues de jfrog/jfrog-cli-security

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.