node.js - Why is which not resolving the binary that comes first in my PATH from nodejs? -
i'm observing when path
looks dir_1:dir_2:...dir_n
, which
not report binary expect when executed nodejs. expect binary exists in dir_1
reported.
here's example. path is:
/var/folders/fr/wzg7ht8x7_x7dcjz036g1wlc0000gp/t/squish_squash_0_3b37fb8eed:/library/frameworks/python.framework/versions/3.6/bin:/usr/local/bin:/users/cdieringer/.yarn/bin:/users/cdieringer/.cargo/bin:/home/cdieringer/node/:/home/cdieringer/node/selenium_drvers_osx/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/x11/bin:/usr/local/share/dotnet:/library/frameworks/mono.framework/versions/current/commands:/library/tex/texbin:/applications/wireshark.app/contents/macos:/users/cdieringer/bin:/usr/local/bin/npm
take note of first dir in path!
now, when execute which node -a
in child_process
nodejs, node /usr/local
shows first, not 1 /var/folders
. arg!
/usr/local/bin/node /var/folders/fr/wzg7ht8x7_x7dcjz036g1wlc0000gp/t/squish_squash_0_3b37fb8eed/node /usr/local/bin/node /usr/local/bin/node
if open fresh terminal , path=<path-shown-above> node
, indeed see /var/folders
executable.
i wrote little library sole purpose in life attempt temporarily squash command processes run user while current process running library alive. not being able reliably resolve squashed executable bringin me down!
o/s: osx, el cap.
Comments
Post a Comment