Closed kanaka closed 2 hours ago
@kanaka I think this is a bug in Node.js itself. Given this script:
scratch.mjs
:
console.log(process.argv);
and when I call it with:
node scratch.mjs --env-file .env
I see:
$ node scratch.mjs --env-file .env
node: .env: not found
Note that nbb doesn't call node, node calls nbb. So there's nothing I can do about this.
This seems to be fixed in a later version of Node. I tested with 22.9.0
and there it works.
Yeah, I had just discovered the same thing. Thanks for the quick followup.
version
1.3.195
platform
Ubuntu 22.04 and node v20.11.1
problem
nbb is passing some command line arguments to node before also passing them to the program itself. This is probably a misbehavior but if it's intentional, then there should be a way to avoid this using the "--" separator.
repro
expected behavior
The
--env-file
option should only apply to the program and not be passed to node. Or, if that's intended, then at least the "--" separator should stop that behavior.