bulk icon indicating copy to clipboard operation
bulk copied to clipboard

Doesn't seem to be working in Windows

Open kumarharsh opened this issue 8 years ago • 3 comments

I'm trying to run this command:

linklocal link -r && linklocal list -r | bulk -c 'npm install --loglevel http'

but it fails with this error:

Listed 2 dependencies                                                                                        
internal/child_process.js:298                                                                                
    throw errnoException(err, 'spawn');                                                                      
    ^                                                                                                        

Error: spawn UNKNOWN                                                                                         
    at exports._errnoException (util.js:870:11)                                                              
    at ChildProcess.spawn (internal/child_process.js:298:11)                                                 
    at exports.spawn (child_process.js:362:9)                                                                
    at Object.<anonymous> (D:\Workspace\project\node_modules\bulk\cli.js:11:28)                                                                                 
    at Module._compile (module.js:410:26)                                                                    
    at Object.Module._extensions..js (module.js:417:10)                                                      
    at Module.load (module.js:344:32)                                                                        
    at Function.Module._load (module.js:301:12)                                                              
    at Function.Module.runMain (module.js:442:10)                                                            
    at startup (node.js:136:18)                                                                              

Running bulk separately by just running ./node_modules/.bin/bulk throws the same error.

kumarharsh avatar Mar 15 '16 07:03 kumarharsh

@kumarharsh sorry I don't have a windows machine to even test this on

timoxley avatar Mar 26 '16 12:03 timoxley

Apparently https://github.com/IndigoUnited/node-cross-spawn is the solution, could you put together a PR and test that it works on windows?

timoxley avatar Mar 26 '16 12:03 timoxley

@timoxley apparently just replacing the 'child_process.spawn' in the cli.js file does the trick. Kindly review the PR I've made. Though spawn is also used in index.js and bulk.js files, but just replacing the occurence in cli.js lets me run the above command.

A question: should I replace all occurences of spawn with cross-spawn? I'm rather in favour of replacing all occurences, as I don't see any immediate side-effect of doing this.

kumarharsh avatar Jun 15 '16 13:06 kumarharsh