Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

"shell.ln" still throws error string "ln: EEXIST" even when running with "-f"

Abierto
#1,039 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Comience en los puntos de entrada shell.ln y shell.error y reproduzca el comando con un archivo de destino existente y los flags -sf. Confirme que un enlace forzado correcto hace que shell.error() devuelva null, y añada o ejecute cobertura de regresión para ese comportamiento.

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

Descripción

Version: 0.8.4

Run the following piece of code and ensure that the target file already exists.

      shell.ln('-sf', target, file);
      const err = shell.error();
      if (err) {
        shell.exit(1);
      }

Despite no actual error message being thrown, internally in shelljs it seems to have kept the error message... the above code will exit because shell.error would still throw the error string ln: EEXIST blah blah.

Expected behavior would be that shell.error should return null when using with -f switch.

The workaround right now, I have to do something like this...

      shell.ln('-sf', target, file);
      const err = shell.error();
      if (err) {
        // for some reason '-sf' still throws error EEXIST
        if (!err.includes('ln: EEXIST')) {
          shell.exit(1);
        }
      }
Lenguaje dominante
JavaScript
Estrellas
14.4k
Forks
757
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

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 shelljs/shelljs

Todos los issues de shelljs/shelljs

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.