mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
fix: check node version and find acceptable host accordingly (#3599)
This commit is contained in:
parent
f1f207839a
commit
0ffc350c8d
2 changed files with 8 additions and 1 deletions
5
.changeset/kind-feet-double.md
Normal file
5
.changeset/kind-feet-double.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix: find a hosting network differently based on Node version
|
|
@ -86,7 +86,9 @@ export function devStart({
|
||||||
const ipv4Networks = Object.values(os.networkInterfaces())
|
const ipv4Networks = Object.values(os.networkInterfaces())
|
||||||
.flatMap((networkInterface) => networkInterface ?? [])
|
.flatMap((networkInterface) => networkInterface ?? [])
|
||||||
.filter(
|
.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) {
|
for (let { address } of ipv4Networks) {
|
||||||
if (address.includes('127.0.0.1')) {
|
if (address.includes('127.0.0.1')) {
|
||||||
|
|
Loading…
Reference in a new issue