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

child_process needs to use shell #202

Open
shavyg2 opened this issue Nov 11, 2017 · 1 comment
Open

child_process needs to use shell #202

shavyg2 opened this issue Nov 11, 2017 · 1 comment

Comments

@shavyg2
Copy link

shavyg2 commented Nov 11, 2017

var cmd = nodeArgs.concat(wrapper, script, scriptArgs);
    child = fork(cmd[0], cmd.slice(1), {
      cwd: process.cwd(),
      env: process.env
    });

should be

var cmd = nodeArgs.concat(wrapper, script, scriptArgs);
    child = fork(cmd[0], cmd.slice(1), {
      cwd: process.cwd(),
      env: process.env,
      shell:true
    });

This would allow it to work on windows and should be able to spawn cmd files.
The is because on windows a global module is in a file eg. mocha.cmd

when you call mocha the shell will look for mocha.exe, mocha.cmd etc
however, if you are not using the shell it will only look for mocha.exe

therefore node-dev mocha fails

with shell as true

it will run the mocha.cmd file

@shavyg2
Copy link
Author

shavyg2 commented Nov 11, 2017

I realize you are using fork so you can send messages.

is the intended usage to only call js / (node executable files)

so something like node-dev mocha should not work?

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

No branches or pull requests

1 participant