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
When I am executing some command like this on PowerShell (also on PowerShell Core v7.1.0) on Windows 10:
concurrently --kill-others 'sleep 2''sleep 5'
I am getting response like this:
[0] 'sleep' is not recognized as an internal or external command,
[0] operable program or batch file.
[1] 'sleep' is not recognized as an internal or external command,
[1] operable program or batch file.
[0] sleep 2 exited with code 1--> Sending SIGTERM to other processes..
[1] sleep 5 exited with code 1
sleep in PowerShell is an alias for Start-Sleep which is not available in cmd. I tried replacing sleep with its original name itself but that also didn't worked. Then I tried running concurrently 'ls' (another alias), it didn't worked. Tried with dir instead (the cmd equivalent) and it worked giving structure in cmd's style. (In PowerShell, dir is an alias for Get-ChildItem, which presents the output in quite a different way from cmd's dir). Clearly, whatever concurrently is running, it is running on cmd.
Also the error message, if it had been PowerShell, would be
The term 'ProgramName' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
But in case of cmd, it is like:
'ProgramName' is not recognized as an internal or external command,
operable program or batch file.
which again proves my point, that concurrently even after being invoked from PowerShell is running code on cmd.
What's the issue here?
I want to run my scripts on PowerShell if I am invoking it from PowerShell.
Some more analysis:
I have git for Windows installed in my system, so I tried running concurrently from git-bash (MinGW64), there concurrently is working fine. It is executing passed commands using the MinGW shell only.
Current Workaround:
Use PowerShell as if you are invoking it from cmd:
However, if I change double quotes with single quotes and vice-versa, I get this error:
~> concurrently --kill-others 'pwsh -Command "sleep 2"' 'pwsh -Command "sleep 5"'
C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\src\command-parser\expand-npm-shortcut.js:3
const [, npmCmd, cmdName, args] = commandInfo.command.match(/^(npm|yarn|pnpm):(\S+)(.*)/) || [];
^
TypeError: commandInfo.command.match is not a function
at ExpandNpmShortcut.parse (C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\src\command-parser\expand-npm-shortcut.js:3:63)
at C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\src\concurrently.js:72:69
at arrayMap (C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\node_modules\lodash\lodash.js:639:23)
at map (C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\node_modules\lodash\lodash.js:9580:14)
at Function.flatMap (C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\node_modules\lodash\lodash.js:9283:26)
at C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\src\concurrently.js:72:33
at Array.reduce (<anonymous>)
at parseCommand (C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\src\concurrently.js:71:20)
at C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\src\concurrently.js:36:29
at arrayMap (C:\Users\brc-dd\AppData\Roaming\npm\node_modules\concurrently\node_modules\lodash\lodash.js:639:23)
The text was updated successfully, but these errors were encountered:
Unlike @brc-dd I am currently running into the exact same issue with MinGW64 (through git-bash). This is proving a major problem as running a command through concurrently starts cmd. This results in concurrently not shutting down cleanly as cmd waits for confirmation in the form of user input when 'Ctrl+C'ing something out of existence. ("Terminate batch job? (Y/N)"). It also makes me question the consistency for concurrently for projects with multiple developers on multiple environments. I would expect the commands to run in the shell they were executed from in the first place.
In the meantime, I will emulate the above fix and explicitly call a shell to execute my commands in, but it does feel like a very contrived way to parallelise execution and definitely doesn't work cross-platform.
Problem:
When I am executing some command like this on PowerShell (also on PowerShell Core v7.1.0) on Windows 10:
I am getting response like this:
Expected behavior:
It should be as shown in this GIF in README.
My Analysis:
sleep
in PowerShell is an alias forStart-Sleep
which is not available incmd
. I tried replacingsleep
with its original name itself but that also didn't worked. Then I tried runningconcurrently 'ls'
(another alias), it didn't worked. Tried withdir
instead (thecmd
equivalent) and it worked giving structure incmd
's style. (In PowerShell,dir
is an alias forGet-ChildItem
, which presents the output in quite a different way fromcmd
'sdir
). Clearly, whateverconcurrently
is running, it is running oncmd
.Also the error message, if it had been PowerShell, would be
But in case of
cmd
, it is like:'ProgramName' is not recognized as an internal or external command, operable program or batch file.
which again proves my point, that
concurrently
even after being invoked fromPowerShell
is running code oncmd
.What's the issue here?
I want to run my scripts on PowerShell if I am invoking it from PowerShell.
Some more analysis:
I have
git
for Windows installed in my system, so I tried running concurrently fromgit-bash
(MinGW64), thereconcurrently
is working fine. It is executing passed commands using the MinGW shell only.Current Workaround:
Use PowerShell as if you are invoking it from
cmd
:However, if I change double quotes with single quotes and vice-versa, I get this error:
The text was updated successfully, but these errors were encountered: