-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
cli: NODE_OPTIONS does not support --require/-r + path with spaces #12971
Comments
Due to this issue, https://github.com/nodejs/node/blob/master/test/parallel/test-cli-node-options.js fails with spaces in the path to repo root and this cannot be fixed in the test. cc @sam-github |
I punted on this because I can't see any credible use-case for module names that have spaces in them. However, I didn't consider that Windows occaisonally forces/encourages top-level directory names with spaces in them. This can be fixed in the test, its choosing to use absolute paths ATM, that's not necessary, relative paths would work fine. I'll rework the test, first. @vsemozhetbyt do you think its really necessary to add a full-blown argv parser in C++ that understands |
@sam-github Yes, it is not the name only, it is the same with spaces in any folder during the module path. I've just use space in the name for an easier repro. Unfortunately, I do not know C++ and cannot understand all the implementation burden. But now we have a different behavior of cli |
The difference is the shell, shells parse the quotes (not the node CLI), but with env vars there is no shell, so some subset of what the shell does would need to also be implemented by node. Which is doable. |
Well, maybe this is not worth it. I've just stumble upon this fixing #12773. Feel free to close if this is of lowest priority. |
Its an issue, I'll look at it sometime. It would be more important if people run into it in practice, but I'm not sure they will. In your particular case, I can't even build node, much less run the tests, see #12773 (comment) Having modules with spaces in their name |
Should this remain open? |
Probably, since #21575 has just been opened about the same issue. |
It's likely this issue will appear a bit more. Yarn will use Note that imo supporting a full-blown parser with both |
I've opened #24065 with a fix. |
The characters specified within NODE_OPTIONS can now be escaped, which is handy especially in conjunction with `--require` (where the file path might happen to contain spaces that shouldn't cause the option to be split into two). Fixes: nodejs#12971
The characters specified within NODE_OPTIONS can now be escaped, which is handy especially in conjunction with `--require` (where the file path might happen to contain spaces that shouldn't cause the option to be split into two). Fixes: nodejs#12971 PR-URL: nodejs#24065 Reviewed-By: Anna Henningsen <anna@addaleax.net>
The characters specified within NODE_OPTIONS can now be escaped, which is handy especially in conjunction with `--require` (where the file path might happen to contain spaces that shouldn't cause the option to be split into two). Fixes: #12971 PR-URL: #24065 Backport-PR-URL: #35342 Reviewed-By: Anna Henningsen <anna@addaleax.net> Refs: microsoft/vscode-js-debug#769
Refs: #12028
test.js
:module.js
:"mo dule.js"
:Compare:
The text was updated successfully, but these errors were encountered: