Nexe eats up any command line parameter starting with -- like --help
taeguscromis opened this issue · 3 comments
What happened:
If I run the binary I got with nexe with one argument that starts wth -- like --help this happens
c:\Projects\conceal-guardian>guardian-win64.exe --help
[
'c:\Projects\conceal-guardian\guardian-win64.exe',
'c:\Projects\conceal-guardian\index.js'
]
It eats up the argument. If I run it without the -- it works as expected. This seems to be happening only on node 20x. On 18x I do not have this issue.
c:\Projects\conceal-guardian>guardian-win64.exe testArg
[
'c:\Projects\conceal-guardian\guardian-win64.exe',
'c:\Projects\conceal-guardian\index.js',
'testArg'
]
What you expected to happen:
On windows if I run my project with node directly and add --help as first argv it works as expected. I get 3 arguments in the array
C:\Projects\conceal-guardian>node index.js --help
[
'C:\Program Files\nodejs\node.exe',
'c:\Projects\conceal-guardian\index.js',
'--help'
]
How to reproduce it (as minimally and precisely as possible):
Just do a dummy app that just reads the arguments. I printed it out in my example simply with
console.log(process.argv);
So there is as minimal case as possible
Anything else we need to know?:
Environment:
- Platform(OS/Version): Windows
- Host Node Version: Node 20x
- Target Node Version: Node 20x
- Nexe version: 4.0.0-rc.4
- Python Version: 3
+1
Trying to use test.exe --debug
and getting:
[DEP0062]: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` and `node --inspect-brk` instead.
Works if pushed down the argv order e.g. test.exe 1 --debug
[
'...dist\\test.exe',
'...dist\\main.js',
'1',
'--debug'
]
Came here to report the same but here is the workaround: #1082
Not really the best option as then you need to explain that to your users. Unless we can somehow auto inject that with node 20x. For now I am just building with node 18x for both platforms. But cannot do that forever.