node icon indicating copy to clipboard operation
node copied to clipboard

node --run doesn't split additional params

Open alexsch01 opened this issue 10 months ago • 3 comments

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' ]

alexsch01 avatar Apr 28 '24 22:04 alexsch01

/cc @anonrig

aduh95 avatar Apr 28 '24 23:04 aduh95

Thanks. I'll follow up once https://github.com/nodejs/node/pull/52609 lands.

anonrig avatar Apr 28 '24 23:04 anonrig

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'
]

alexsch01 avatar Apr 30 '24 10:04 alexsch01