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

spawns with a different version of node on Travis #8

Closed
kentcdodds opened this issue Feb 10, 2017 · 0 comments
Closed

spawns with a different version of node on Travis #8

kentcdodds opened this issue Feb 10, 2017 · 0 comments

Comments

@kentcdodds
Copy link

I'm not sure what causes this, but I've reproduced the issue in this repo with this build

Here's the output:

screen shot 2017-02-09 at 8 36 15 pm

Here's the code for that:

.travis.yml

language: node_js
cache:
  directories:
    - node_modules
node_js:
  - '6'
script:
  - npm run test

spawn.js

const defaultShell = require('spawn-default-shell')
const spawn = require('spawn-command')

go(defaultShell.spawn, 'spawn-default-shell').then(() => {
  go(spawn, 'spawn-command')
})

function go(spawnerFn, label) {
  console.log(`\n\n${label}\n`)
  const child = spawnerFn('./log-node-version.js')
  return new Promise(resolve => {
    child.stdout.on('data', (data) => {
      console.log(`${label}: stdout: ${data}`)
    })
    
    child.stderr.on('data', (data) => {
      console.log(`${label}: stderr: ${data}`)
    })
    
    child.on('close', (code) => {
      console.log(`${label}: child process exited with code ${code}`)
      resolve()
    })
  })
}

log-node-version.js

#!/usr/bin/env node

console.log('node version:', process.version)

You'll notice that spawn-command doesn't have the same problem. Is there anything that spawn-default-shell can do that spawn-command cannot? Perhaps concurrently could use spawn-command instead and spawn-default-shell can be deprecated?

Anyway, this is causing broken builds in my PR here which is why I bring it up. I'd really like to use concurrently! Let me know how I can help.

Thanks!

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