Skip to content

Node 10.x version check fails #64

Closed

Description

@kiswa

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)
});

Activity

  1. self-assigned this
    on Jun 20, 2018
  2. darkguy2008 commented on Jun 20, 2018

    @darkguy2008
    Owner

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

  3. nikolowry commented on Jun 21, 2018

    @nikolowry

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

  4. t3chguy commented on Jun 24, 2018

    @t3chguy

    @darkguy2008 +1 to

    could you release the fix?

  5. alexander-schranz commented on Jul 4, 2018

    @alexander-schranz

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

  6. Jab2870 commented on Jul 9, 2018

    @Jab2870

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

  7. roopemerikukka commented on Aug 7, 2018

    @roopemerikukka

    Has this been released to npm yet? ping @darkguy2008

  8. alexander-schranz commented on Aug 7, 2018

    @alexander-schranz

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

  9. edrcq commented on Jun 15, 2019

    @edrcq
    Contributor

    I hope it helps

    8d9df71

  10. bizzyvinci commented on Apr 22, 2020

    @bizzyvinci

    YES!

    Thanks a lot. It worked

  11. darkguy2008 commented on Sep 27, 2026

    @darkguy2008
    Owner

    Hey! This is fixed on 3.0.3 (npm i parallelshell@latest). parallelshell doesn't pass cwd or env to spawn anymore, so there's no Node version check left to break 😊 If you're stuck on an older major, 2.0.1 (npm i parallelshell@legacy-2) and 1.2.1 (npm i parallelshell@legacy-1) have the fix too. Feel free to reopen if it's still happening. Thanks!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions