-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
Labels
Milestone
Description
We should replace process.execPath
with something like common.execPath
. While process.execPath
does not always point to NodeJS (like if it's running within electron), common.execPath
ideally should, allowing us to reliably use the within exec
and other utilities.
At startup, we can set common.execPath
to:
process.execPath
if not within electron- otherwise use
which('node')
if it returns something - otherwise use
which('nodejs')
if it returns something - otherwise we can leave it null and fail early whenever we try to use it (like in
shell.exec
), displaying a descriptive error message (at least an improvement over the current cryptic error message).
Also, this would allow electron users to manually override common.execPath
with the hardcoded path of their NodeJS binary if the above approach fails. While not ideal, that should at least be a suitable workaround until we can figure out a solid way to reliably get a path to the current node instance.
Linking this to #480