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

node --run doesn't split additional params #52740

Closed
alexsch01 opened this issue Apr 28, 2024 · 3 comments · Fixed by #52810
Closed

node --run doesn't split additional params #52740

alexsch01 opened this issue Apr 28, 2024 · 3 comments · Fixed by #52810
Assignees
Labels
cli Issues and PRs related to the Node.js command line interface. confirmed-bug Issues with confirmed bugs.

Comments

@alexsch01
Copy link
Contributor

alexsch01 commented Apr 28, 2024

Version

v22.0.0

Platform

Linux penguin 6.6.21-01327-gc9107f2d4947 #1 SMP PREEMPT_DYNAMIC x86_64 GNU/Linux

Subsystem

node --run

What steps will reproduce the bug?

mkdir nodeRunBug
cd nodeRunBug
echo 'console.log(process.argv)' > script.js
echo '{"scripts":{"test":"node script.js"}}' > package.json
node --run test -- A B

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

[ '/usr/bin/node', '/home/alex/nodeRunBug/script.js', 'A', 'B' ]
(node:8670) ExperimentalWarning: Task runner is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

What do you see instead?

[ '/usr/bin/node', '/home/alex/nodeRunBug/script.js', 'A B' ]
(node:8670) ExperimentalWarning: Task runner is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

Additional information

$ npm run test -- A B

> test
> node script.js A B

[ '/usr/bin/node', '/home/alex/nodeRunBug/script.js', 'A', 'B' ]
@aduh95 aduh95 changed the title node --run doesn't work the same as npm run node --run doesn't split additional params Apr 28, 2024
@aduh95
Copy link
Contributor

aduh95 commented Apr 28, 2024

/cc @anonrig

@anonrig anonrig self-assigned this Apr 28, 2024
@anonrig anonrig added the confirmed-bug Issues with confirmed bugs. label Apr 28, 2024
@anonrig
Copy link
Member

anonrig commented Apr 28, 2024

Thanks. I'll follow up once #52609 lands.

@alexsch01
Copy link
Contributor Author

alexsch01 commented Apr 30, 2024

Windows 10.0.19045.4170, Node.js v22.0.0
(same results on Command Prompt, Windows PowerShell, and Git Bash)

PATH>node --run test -- A B
[
  'NODE_22_PATH_TO_EXE',
  'PATH\\script.js',
  "'A",
  "B'"
]
(node:21628) ExperimentalWarning: Task runner is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PATH>npm run test -- A B

> test
> node script.js A B

[
  'NODE_22_PATH_TO_EXE',
  'PATH\\script.js',
  'A',
  'B'
]

@RedYetiDev RedYetiDev added the cli Issues and PRs related to the Node.js command line interface. label May 2, 2024
nodejs-github-bot pushed a commit that referenced this issue May 8, 2024
PR-URL: #52810
Fixes: #52740
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
targos pushed a commit that referenced this issue May 11, 2024
PR-URL: #52810
Fixes: #52740
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs related to the Node.js command line interface. confirmed-bug Issues with confirmed bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants