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

nvexeca is hanging #1

Closed
sndrs opened this issue Mar 12, 2020 · 3 comments
Closed

nvexeca is hanging #1

sndrs opened this issue Mar 12, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@sndrs
Copy link

sndrs commented Mar 12, 2020

Describe the bug

The promise returned by called nvexeca never seems to resolve (or rather, seems to have stopped...).

Steps to reproduce

#!/usr/bin/env node

const nvexeca = require('nvexeca')

// force process to stay alive
const timer = setTimeout(() => {
	console.log('time is up')
}, 3000)

const p = nvexeca('8', 'echo', ['hello'], { stdio: 'inherit', progress: true })
	.then(result => {
		console.log('then', result)
	})
	.catch(result => {
		console.log('catch', result)
	})
	.finally(result => {
		console.log('finally', result)
		clearTimeout(timer)
	})

console.log('p', p)

Results in the following:

image

Expected behavior

If I try running this with plain execa, like so:

#!/usr/bin/env node

const execa = require('execa')

// force process to stay alive
const timer = setTimeout(() => {
	console.log('time is up')
}, 3000)

const p = execa('echo', ['hello'], { stdio: 'inherit' })
	.then(result => {
		console.log('then', result)
	})
	.catch(result => {
		console.log('catch', result)
	})
	.finally(result => {
		console.log('finally', result)
		clearTimeout(timer)
	})

console.log('p', p)

you get the following output:

image

which makes sense.

Configuration

I have had it working, and deleted ~/Library/Caches/nve to trigger a new download of node, and now it's not working. I'm not sure if it stopped straight away or what was different when it did work, sorry! Just incase that helps...

Environment

Enter the following command in a terminal and copy/paste its output:

❯ npx envinfo --system --binaries --browsers --npmPackages nvexeca

  System:
    OS: macOS 10.15.3
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 30.67 GB / 64.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 13.10.1 - ~/.nvm/versions/node/v13.10.1/bin/node
    Yarn: 1.21.0 - ~/Dev/oh/node_modules/.bin/yarn
    npm: 6.13.7 - ~/.nvm/versions/node/v13.10.1/bin/npm
  Browsers:
    Chrome: 80.0.3987.132
    Firefox: 74.0
    Firefox Developer Edition: 69.0
    Safari: 13.0.5
  npmPackages:
    nvexeca: 2.1.1 => 2.1.1 

Am I doing something silly?

@sndrs sndrs added the bug Something isn't working label Mar 12, 2020
@ehmicky
Copy link
Owner

ehmicky commented Mar 12, 2020

Thanks for reporting this bug @sndrs!

This is due to a bug in Node.js itself, for the versions 13.10.0 and 13.10.1. This bug creates the following issue in got which is used to download the Node.js binary (when it has not already been downloaded and cached locally). This makes nvexeca hang forever during that download.

To fix this problem, please upgrade to Node.js 13.11.0 (Node.js 13.9.0 works as well).

Please let me know if this fixes the problem for you!

@sndrs
Copy link
Author

sndrs commented Mar 12, 2020

oh wow, yeah that totally fixed it – thank you! nasty one :)

@sndrs sndrs closed this as completed Mar 12, 2020
@sndrs
Copy link
Author

sndrs commented Mar 14, 2020

for anyone who finds this later on, a semver range of >=10.17.0 <13.10.0 || >=13.11.0 should catch any installs that depend on nvexaca and are susceptible to this bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants