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

Windows support #8

Open
Globegitter opened this issue Jan 18, 2015 · 9 comments
Open

Windows support #8

Globegitter opened this issue Jan 18, 2015 · 9 comments

Comments

@Globegitter
Copy link

It seems when I try to use this on windows I just get the error spawn ENOENT. I am writing a cli tool that is working fine on Linux and Mac, but not on windows.

I am still running a few tests (slowly) but right now it seems like the error is due to this library. Will update if I make more progress.

Edit: Yep, changing to https://www.npmjs.com/package/superspawn fixes the issue.

@patrick-steele-idem
Copy link
Owner

I don't use Windows so this is not something I can test. If you want to submit a PR to support Windows then feel free, but this is not something I can work on. It looks like superspawn just adds some extra logic to resolve the executable on a Windows machine:
https://github.com/MarcDiethelm/superspawn/blob/dc06b8c3aa1ead2fef9e94f01c2702edbfbd5cdb/lib/index.js

@patrick-steele-idem
Copy link
Owner

Labeling as an enhancement since this module is just using require('child_process').spawn directly and it is not a bug in this module that is preventing it from working on Windows.

@patrick-steele-idem
Copy link
Owner

On second thought, I don't think logic to resolve a Windows executable belongs in this module. It is probably better for the caller to pre-resolve the executable before using this module. There's a lot of magic happening in superspawn and there is some synchronous blocking code when searching for executables.

@ben3005
Copy link

ben3005 commented Feb 10, 2016

could this library use something like this:

https://github.com/IndigoUnited/node-cross-spawn

so that it works on windows?

@lshearer
Copy link

This module looks like the nicest promise implementation of spawn available, but the lack of Windows support is a deal breaker for us.

As @ben3005 mentioned, https://github.com/IndigoUnited/node-cross-spawn is a popular solution for the windows spawn issues and is a drop-in replacement for child_process.spawn. It would be awesome to have this integrated.

If bringing in a dependency is a concern, it would be nice to at least make the spawn method configurable, maybe something like:

const spawn = require('child-process-promise').useSpawn(require('cross-spawn')).spawn;

spawn(...).then(...)
...

That would let us easily use the two modules together, or potentially publish a second module that combines the two (e.g., cross-child-process-promise) to make things even cleaner.

@patrick-steele-idem
Copy link
Owner

I support the idea of making the spawn method configurable. I don't have a Windows machine or Windows VM set up, but if someone who does wants to contribute back I would be happy to review and merge if everything looks good. Also, if anyone has any experience on setting up automated tests in a Windows environment (e.g. AppVeyor) that would be very helpful for this project. Thanks for comments so far!

TintypeMolly added a commit to TintypeMolly/child-process-promise that referenced this issue Oct 7, 2016
patrick-steele-idem added a commit that referenced this issue Oct 15, 2016
use cross-spawn for windows #8
@borekb
Copy link

borekb commented Nov 1, 2016

Seems to be working on Windows since TintypeMolly@8a08e9c, thanks!

It's README-worthy, IMO.

@zrisher
Copy link

zrisher commented Apr 10, 2017

Confirmed working for me on Windows as well, perhaps this issue can be closed?

@kachkaev
Copy link

kachkaev commented Jan 30, 2018

@Globegitter can we close please this? I came across child-process-promise repo and saw this issue opened, so almost ignored the module.

johan added a commit to johan/child-process-promise that referenced this issue Feb 12, 2018
johan added a commit to johan/child-process-promise that referenced this issue Feb 12, 2018
johan pushed a commit to johan/child-process-promise that referenced this issue Feb 12, 2018
johan pushed a commit to johan/child-process-promise that referenced this issue Feb 12, 2018
johan added a commit to johan/child-process-promise that referenced this issue Feb 12, 2018
johan added a commit to johan/child-process-promise that referenced this issue Feb 12, 2018
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