find-free-port icon indicating copy to clipboard operation
find-free-port copied to clipboard

Does not work for node v18.9.0 ?

Open ApolloTang opened this issue 2 years ago • 2 comments

After upgrading to node v18.9.0 (from v16), find-port-port failed to detect a port that is already being used.

ApolloTang avatar Sep 25 '22 05:09 ApolloTang

issue repo:

https://github.com/ApolloTang/issue--find-free-port-not-working-on-node-18

ApolloTang avatar Sep 25 '22 06:09 ApolloTang

I think I found the problem: after passing in the host it now works, see: https://github.com/ApolloTang/issue--find-free-port-not-working-on-node-18/blob/host-is-required-for-node18/issue.js#L8

I think that is because the host is now required for the net.createConnection() method for node 18, see:
https://github.com/mhzed/find-free-port/blob/master/index.js#L23

ApolloTang avatar Sep 25 '22 07:09 ApolloTang