Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nexe eats up any command line parameter starting with -- like --help #1084

Open
taeguscromis opened this issue Feb 27, 2024 · 3 comments
Open
Labels

Comments

@taeguscromis
Copy link

taeguscromis commented Feb 27, 2024

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
@qu1rk3y
Copy link

qu1rk3y commented Feb 28, 2024

+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'
]

@shoustech
Copy link

shoustech commented Mar 1, 2024

Came here to report the same but here is the workaround: #1082

@taeguscromis
Copy link
Author

taeguscromis commented Mar 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants