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
{{ message }}
Repository navigation
[Bug]: use of an absolute path to an executable which contains spaces leads to errors using powershell #1551
This should make sure that the node which started the script is used for sub commands, too.
In my case the process.execPath is C:\Program Files\nodejs\node.exe it contains a space in Program Files.
The effect is that zx is quoting the command.
This seems to work fine in Linux.
But Powershell interprets it not as command but as expression and its execution fails.
An error like "Operator -- not recognized" occurs.
How it should work?
Our current workarround is to use $.prefix = "& ";
This ensures that the command is understood.
Another way is to quote whitespace of the command with a backtick, e.g.
C:\Program Files\nodejs\node.exe --version`
I would like that if the first parameter given to zx is the command and must be quoted that then the & prefix is appended automatically or an alternative quoting strategie (backticks) is used here.
This would help to produce cross platform scripts with zx.
How to reproduce the bug?
Step-by-step instructions:
I attached a zip file, which reproduces the error if you have node installed like described above.
Hi, I'm a contributor looking to help out. This issue still looks open and unclaimed — is it free to take? I'd like to work on a fix for the absolute-path-with-spaces failure under PowerShell. Thanks!
Activity
fix(core): prepend call operator for quoted commands in PowerShell (g…
vurumalla92 commentedon Nov 23, 2026
Hi, I'm a contributor looking to help out. This issue still looks open and unclaimed — is it free to take? I'd like to work on a fix for the absolute-path-with-spaces failure under PowerShell. Thanks!