ExternalRuntime command searching slightly incompatible with nodenv

Aperta
#59 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, nodejs, ruby

Direzione di ricerca

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.

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

Descrizione

(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.

Lingua principale
Ruby
Stelle
581
Fork
285
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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

Tutte le issue di rails/execjs

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.