Spawn node in electron-packager project


#1

I am developing an electron application that uses “var child = ChildProcess.spawn(‘node’, …”.
All works fine with electron, but when the application is packaged by electron-packager, the reference to node fails at this statement with the following message :
"uncaught Error : spawn node ENOENT."
I didn’t find how to refer to node in the packaged context.
Thanks if you can help.


#2

I found the explanation in
https://electron.atom.io/docs/all/#executing-binaries-inside-asar-archive
"There are Node APIs that can execute binaries like child_process.exec, child_process.spawn and child_process.execFile, but only execFile is supported to execute binaries inside asar archive."
Thanks!


#3

Did you eventually use something like:
execFile('node', ['/path/to/your/script']) ?
Because that doesn’t seem to work for me when app is packaged.

I didn’t find how to refer to node in the packaged context.
Did you solve that? Thanks!