You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's because process.argv almost always contains node and the script name as the first two items, e.g. [ 'node', 'example.js', '--help' ]. I think you have found a case (Electron) where this is not true.
As you've discovered, passing in your own argv array works around this issue and I'll take a look into other options, too. If there is a reliable way of detecting command-line-args is running within an Electron app, and Electron apps only ever need one arg trimming from the front of process.argv and not two then we could put a permanent fix in.
I'm running v5.1.1 in an Electron app.
I have the following code
I am then executing:
And I get the following output:
If I pass just a single argument then the options has no properties defined.
I've also tried directly passing in
process.argv
with the same result.The text was updated successfully, but these errors were encountered: