unjs / get-port-please

🔌 Get an available open port
MIT License
255 stars 13 forks source link

prefer explicit `port/portRange` even if `random: true` is passed #65

Closed davidfirst closed 10 months ago

davidfirst commented 1 year ago

Environment

Mac, node 18.

Reproduction

await p.getPort({ random: true, portRange: [5000, 6000]  });

output:

63493

Describe the bug

I get number that are not part of the specified range. (I tried also alternativePortRange, same issue).

pi0 commented 10 months ago

Thanks for report. Should be resolved by https://github.com/unjs/get-port-please/commit/cd4acec1245c7241000cd88f623192709574a370 in next release.