Node CLI options take precedence in latest Node v10
See original GitHub issueIs this a BUG or a FEATURE REQUEST?:
A bug
What happened:
Passing CLI options to the executable was working fine in Node v8.9.4.
Since upgrading to Node v10.13.0, CLI options (--x
) seem to be parsed with Node instead of being passed to the application.
What you expected to happen:
The application receiving the CLI options, not just arguments.
How to reproduce it (as minimally and precisely as possible):
$ echo "console.log(process.argv)" | nexe -t 8.9.4 -o test.exe && test.exe test
-> [ 'path\test.exe', '[stdin]', 'test' ]
$ echo "console.log(process.argv)" | nexe -t 8.9.4 -o test.exe && test.exe --test
-> [ 'path\test.exe', '[stdin]', '--test' ]
$ echo "console.log(process.argv)" | nexe -t 10.13.0 -o test.exe && test.exe test
-> [ 'path\test.exe', '[stdin]', 'test' ]
$ echo "console.log(process.argv)" | nexe -t 10.13.0 -o test.exe && test.exe --test
-> test.exe: bad option: --test
Anything else we need to know?:
Environment
- Platform(OS/Version): Windows 10
- Host Node Version: 10.13.0
- Target Node Version: 8.9.4 and 10.13.0
- Nexe version: 2.0.0-rc.34
- Python Version: 2.7.15
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Command-line API | Node.js v19.3.0 Documentation
Node.js comes with a variety of CLI options. ... Options from the command line take precedence over options passed through the NODE_OPTIONS environment ......
Read more >nodejs-cli-apps-best-practices/README.md at main - GitHub
A collection of curated best practices on how to build successful, empathic and user-friendly Node.js Command Line Interface (CLI) applications. Why this guide?...
Read more >Command line options
Node.js comes with a variety of CLI options. ... Options from the command line take precedence over options passed through the NODE_OPTIONS ...
Read more >config | npm Docs
Description. npm gets its configuration values from the following sources, sorted by priority: Command Line Flags. Putting --foo bar on the command line...
Read more >node.js - How can I set NODE_ENV=production on Windows?
Current versions of Windows use Powershell as the default shell, so use: $env:NODE_ENV="production". Per @jsalonen's answer below.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
They’re cooking, but the project on AppVeyor appears to be down… Unfortunately it triggers the other builds. Not sure when it will get going again. I’ve contacted their support team.
They’re there!