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
Catch OSX port 5000 in-use #4415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this, this was super annoying! One potential extra edge case to cover, but this already looks like a nice improvement.
// enough devexp that we should special case and ensure it's available. | ||
if (process.platform === "darwin") { | ||
try { | ||
execSync(`lsof -i :${port}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking through this, it seems like this only checks if the initial port is being used by osX, and will still break out if a subsequent attempt hits a osx occupied port. Should we include this if (platform == 'darwin') lsof
in portInUse() as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
portInUse recurses, so it should work in subsequent attempts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see line 54
@joehan thanks for the quick turn around on your reviews today! |
OSX is reserving port 5000 in a way that Node's http server is not erroring when you listen on it. Add a special case for this.