Closed dignifiedquire closed 8 years ago
16:20 <+daviddias> dignifiedquire was trying to get it working simply by removing that line 16:20 <+daviddias> it fired up the node 16:21 <+daviddias> we shouldn't have to specify that in the file since it is always run in the node context
The point of subcom binary is that it needs to run as a separate process. We need to find a way to execute it with node without expecting the standard toolchain to be there.
Can we expect node
to be there?
we could remove that line, and then exec it with node directly, by finding where the current node binary from the parent context is located.
we could remove that line, and then exec it with node directly, by finding where the current node binary from the parent context is located.
Agreed
Can we expect node to be there?
You can only expect that the process executing the file has a node binary, but not that it is in the PATH
.
@Dignifiedquire is the actual binary guaranteed to be there and executable? or do we have to do something like fork?
I don't think there is a reliable way to find the path of the executable from inside the running process, so the safest way would be to use child_process.fork
I guess.
@Dignifiedquire isn't process.argv[0]
the node
path?
It looks like process.argv[0]
should be supported everywhere, I've tested it with forked child processes on OS X and that still works, will check on windows now to be sure that it's available as expected there as well.
@jbenet windows checks out as well:
Ok great! let's do that
Published as 1.0.4
thanks @Dignifiedquire
Thanks @jbenet for the quick fix, will test it later
From IRC
It seems the culprit is relying on the hash bang here as that will only work if the enclosing shell does have nodejs in
PATH
, which we can not guarantee when packaging it as a native app as far as I understand.