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
Describe the bug
The shim for node does not process command line arguments correctly, so it does not have feature parity with the actual node executable.
My best interpretation of what is happening is this:
When the shim finds the first non-option argument, it assumes that there are no more options and processes all remaining arguments as if they were files to be run by node.
This type of processing is incorrect, as many of node's options accept arguments. It cannot be assumed that there are no more options after the first non-option argument.
To Reproduce
Install nvshim and run the following:
mkdir test
cd test
echo "v22.14.0" > .nvmrc
echo "FOO=123" > .env1
echo "BAR=456" > .env2
echo "console.log('hello', process.env.FOO, process.env.BAR);" > index.js
node index.js
# output: hello undefined undefined
node --env-file .env1 index.js
# output: <no output at all>
node --env-file .env1 --env-file .env2 index.js
# output: $HOME/.nvm/versions/node/v22.14.0/bin/node: --env-file: not found
Expected behavior
Uninstall nvshim and run the following:
Describe the bug
The shim for
node
does not process command line arguments correctly, so it does not have feature parity with the actual node executable.My best interpretation of what is happening is this:
When the shim finds the first non-option argument, it assumes that there are no more options and processes all remaining arguments as if they were files to be run by
node
.This type of processing is incorrect, as many of
node
's options accept arguments. It cannot be assumed that there are no more options after the first non-option argument.To Reproduce
Install
nvshim
and run the following:Expected behavior
Uninstall
nvshim
and run the following:Screenshots
N/A
Desktop (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: