From 0ffc350c8d6bcf7fe4f6bde7ce1c10c014d7b4a1 Mon Sep 17 00:00:00 2001 From: Ari Gibson Date: Wed, 15 Jun 2022 09:26:55 -0600 Subject: [PATCH] fix: check node version and find acceptable host accordingly (#3599) --- .changeset/kind-feet-double.md | 5 +++++ packages/astro/src/core/messages.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/kind-feet-double.md diff --git a/.changeset/kind-feet-double.md b/.changeset/kind-feet-double.md new file mode 100644 index 000000000000..13722f713d21 --- /dev/null +++ b/.changeset/kind-feet-double.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix: find a hosting network differently based on Node version diff --git a/packages/astro/src/core/messages.ts b/packages/astro/src/core/messages.ts index 05b363c4bb09..7da96d696176 100644 --- a/packages/astro/src/core/messages.ts +++ b/packages/astro/src/core/messages.ts @@ -86,7 +86,9 @@ export function devStart({ const ipv4Networks = Object.values(os.networkInterfaces()) .flatMap((networkInterface) => networkInterface ?? []) .filter( - (networkInterface) => networkInterface?.address && networkInterface?.family === 'IPv4' + (networkInterface) => + networkInterface?.address && + networkInterface?.family === (Number(process.version.substring(1, 5)) < 18.1 ? 'IPv4' : 4) ); for (let { address } of ipv4Networks) { if (address.includes('127.0.0.1')) {