parallelshell icon indicating copy to clipboard operation
parallelshell copied to clipboard

Node 10.x version check fails

Open kiswa opened this issue 7 years ago • 9 comments

This line fails on Node 10.x since it's checking the version with string comparison and 10 is less than 8 in that case.

This could be replaced with:

cwd: Number(process.versions.node.split('.')[0]) < 8
  ? process.cwd
  : process.cwd(),

Or the entire section with:

// start the children
children = [];
var nodeVer = Number(process.versions.node.split('.')[0]);

cmds.forEach(function (cmd) {
    if (process.platform !== 'win32') {
      cmd = 'exec ' + cmd;
    }

    var child = spawn(sh, [shFlag, cmd], {
        cwd: nodeVer < 8 ? process.cwd : process.cwd(),
        env: process.env,
        stdio: ['pipe', process.stdout, process.stderr]
    }).on('close', childClose);

    child.cmd = cmd
    children.push(child)
});

kiswa avatar May 18 '18 15:05 kiswa

Thanks for your contribution! I've pushed a fix now to the main branch, please give it a try :)

darkguy2008 avatar Jun 20 '18 04:06 darkguy2008

@darkguy2008 could you release the fix? Installing from git in the meantime.

nikolowry avatar Jun 21 '18 20:06 nikolowry

@darkguy2008 +1 to

could you release the fix?

t3chguy avatar Jun 24 '18 15:06 t3chguy

@darkguy2008 I tested the fix and it did work for me. So it should be save for a release :).

alexander-schranz avatar Jul 04 '18 19:07 alexander-schranz

@darkguy2008 the fix is working for me, please release on NPM. :)

Jab2870 avatar Jul 09 '18 14:07 Jab2870

Has this been released to npm yet? ping @darkguy2008

roopemerikukka avatar Aug 07 '18 07:08 roopemerikukka

@roopemerikukka no the last release of parallelshell was 2017. I currently did switch to concurrently.

alexander-schranz avatar Aug 07 '18 08:08 alexander-schranz

I hope it helps

https://github.com/darkguy2008/parallelshell/commit/8d9df713c12cc3fdfc09a9291cdcf6b764bc9e8e

edrcq avatar Jun 15 '19 23:06 edrcq

YES!

Thanks a lot. It worked

bizzyvinci avatar Apr 22 '20 04:04 bizzyvinci