Bad argument at ChildProcess.spawn
redloro opened this issue · 8 comments
Got this working great on the Mac and then ported over to RPi to have it throw this error. After some digging find out that the Mac was running electron-html-to@2.2.0 and the RPi was running electron-html-to@2.3.0. After some additional digging find out that the call to get the Electron path is failing... the electron var actually has the entire electron object... not the Electron path.
And this issue is apparently also in electron-workers@1.10.0
electron = getElectronPathFromPackage('electron');
... actually returns the full Electron object and not the file path to the binary as indicated here: https://github.com/electron-userland/electron-prebuilt
Is something misconfigured or is there a simple workaround that I'm missing?
hmm difficult to tell what is happening with no code to reproduce the issue.
what version of the electron
package are you using?
I think 1.4.12 but I'd need to check to be sure... I'll also try and get some sample code posted here so you can see, but basically the require('electron')
call always returns the full Electron object and not the actual path.
are you calling require('electron')
from a node.js app or a electron app? when require('electron')
is called from an electron app it always will give you an object, when is called from a node app (or process) it will give you the path to the executable.
Correct... Calling it from an Electron app.
this module is expected to be used inside a node.js app (node process), so i'm afraid that calling it from a electron app will not work right now.
Having the same issue.
Using electron 1.6.x and electron-html-to 2.5.1
Uncaught Exception:
TypeError: Bad argument
at ChildProcess.spawn (internal/child_process.js:289:26)
at Object.exports.spawn (child_process.js:399:9)
at /home/rcrodrigues/git/PRA_Federal/projetos/tmp/node_modules/electron-workers/lib/ElectronWorker.js:271:57
at ElectronWorker.findFreePort (/home/rcrodrigues/git/PRA_Federal/projetos/tmp/node_modules/electron-workers/lib/ElectronWorker.js:122:9)
at ElectronWorker.start (/home/rcrodrigues/git/PRA_Federal/projetos/tmp/node_modules/electron-workers/lib/ElectronWorker.js:211:10)
at _loop (/home/rcrodrigues/git/PRA_Federal/projetos/tmp/node_modules/electron-workers/lib/ElectronManager.js:243:36)
@rcrodrigues i'm not sure about your issue, do you have a test case where this error happens? just keep in mind that this package is not going to work if you are using it in an electron application, this package works when you use it from a node.js app
Same issue.