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

Spawn error on windows (cygwin) #69

Open
rdettai opened this issue Oct 31, 2016 · 11 comments
Open

Spawn error on windows (cygwin) #69

rdettai opened this issue Oct 31, 2016 · 11 comments

Comments

@rdettai
Copy link

rdettai commented Oct 31, 2016

Concurrently used to work fine for me on windows (cygwin), but since the version 3.0.0 it always triggers the same error:

 Error: spawn /bin/bash ENOENT
     at exports._errnoException (util.js:1036:11)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
     at onErrorNT (internal/child_process.js:359:16)
     at _combinedTickCallback (internal/process/next_tick.js:74:11)
     at process._tickCallback (internal/process/next_tick.js:98:9)
     at Module.runMain (module.js:592:11)
     at run (bootstrap_node.js:394:7)
     at startup (bootstrap_node.js:149:9)
     at bootstrap_node.js:509:3

If you want to reproduce, you can simply use the angular 2 quickstart example and try to run it on this environment.

@kimmobrunfeldt
Copy link
Contributor

Can you upgrade to version 3.1.0 and try again?

@rdettai
Copy link
Author

rdettai commented Oct 31, 2016

I tried it and had the same issue!

Le 31 oct. 2016 12:59 PM, "Kimmo Brunfeldt" [email protected] a
écrit :

Can you upgrade to version 3.1.0 and try again?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/kimmobrunfeldt/concurrently/issues/69#issuecomment-257243302,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHi_g_k-UR0Fnj8xCnBUxuf9cYhE0pw-ks5q5a4OgaJpZM4Kktek
.

@phsstory
Copy link

phsstory commented Nov 1, 2016

as a workaround, 2.2.0 still works

as an aside, the error message is incorrect when using multiple commands, it repeats the same message for all commands.
main.js:~326: var command = childrenInfo[event.child.pid].command;
event.child.pid is undefined and childrenInfo[undefined] exists
This will likely resolve once process spawning is working

@kimmobrunfeldt
Copy link
Contributor

3.0.0 changed the way shells are spawned to allow more flexibility. Check https://github.com/kimmobrunfeldt/spawn-default-shell#spawn-default-shell README for more how it is spawned. It seems that somehow this detection code: https://github.com/kimmobrunfeldt/spawn-default-shell/blob/master/src/get-shell.js#L11 thinks that your shell is indeed /bin/bash but it's not.

You can override this by setting a SHELL=/bin/bash and SHELL_EXECUTE_FLAGS=-l -c (execute flag must be last) environment variables

@phsstory
Copy link

phsstory commented Nov 1, 2016

in cygwin, our shell is /bin/bash (or others) and spawning should be similar to linux and not require an implicit shell

I personally use babun which is a prepacked no hassle cygwin (http://babun.github.io/)

@kimmobrunfeldt
Copy link
Contributor

kimmobrunfeldt commented Nov 1, 2016

I debugged this in a virtual machine. See this issue for more details: kimmobrunfeldt/spawn-default-shell#5.

Temporary workaround for now is to use SHELL=bash concurrently <arguments>.

@kimmobrunfeldt kimmobrunfeldt changed the title Spawn error on windows Spawn error on windows (cygwin) Nov 1, 2016
@kentcdodds
Copy link
Contributor

Does anyone here want to try my fork and let us know whether that works?

npm install https://github.com/kentcdodds/concurrently.git#pr/use-spawn-command

@gustavohenke
Copy link
Member

Published v3.3.0 with the fix by @kentcdodds.
Could you try it, @rdettai, @phsstory?

@marcoso
Copy link

marcoso commented Mar 22, 2017

I tried with v3.3.0 and I was still having the issue, as @phsstory mentioned installing v2.2.0 was the only workaround.

@mikew
Copy link

mikew commented Apr 23, 2017

Yeah spawn-command does nothing to check the SHELL variable, and the logic that was in spawn-default-shell would still error on Windows if your SHELL is really bash.exe.

@ghost
Copy link

ghost commented Feb 1, 2018

I tried to use the latest version of concurrently today and got the same error. Installing version 2.2 did the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants