ExternalRuntime command searching slightly incompatible with nodenv

Abierto
#59 1 comentario 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
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript, nodejs, ruby

Línea de trabajo

Start by reading the ExternalRuntime command-search logic and reproducing the nodenv shim case described in the issue. Determine how an unusable node shim should be treated and verify that the runtime can fall back to JavaScriptCore when appropriate.

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

Descripción

(I thought a bit about how to correct this corner case without significant updates to the library, but didn't come up with anything that I could send over.)

When using nodenv to handle different node versions, but not having a global node version available, the ExternalRuntime logic breaks down. This is due to nodenv providing a path-accessible shim for the node binary regardless of whether it actually points to a valid node install. So, execjs will get through load time successfully, but fall over at runtime when actually shelling out to node.

Here is the gist of the environment:

$ which node
/Users/jimmy/.nodenv/shims/node

$ node
nodenv: node: command not found

The `node' command exists in these Node versions:
  4.2.1
  4.2.6
  4.4.0
  5.4.0
  6.10.0
  7.4.0

This can be avoided by explicitly preferring JavaScriptCore (assuming OSX), but I saw that the order of these was purposely swapped so I assume there are reasons things are the way they are currently. Ideally execjs wouldn't be picking up this install in the first place, and then falling back to JavaScriptCore on its own.

Not a big deal, as it is easily worked around, but it was a gotcha nonetheless and I wanted to make you aware of it.

Lenguaje dominante
Ruby
Estrellas
581
Forks
285
Métricas de merge de PR
Sin PR fusionados en 30 d

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 rails/execjs

Todos los issues de rails/execjs

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.