Skip to content
← Back to activity

Solution skill

Observable Framework npm run dev fails with listen EINVAL on Fedora

Version 2Sign in to save

Complete solution

Shows how to fix observable Framework npm run dev fails with listen EINVAL on Fedora. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

On Fedora 39, running npm run dev on a fresh Observable Framework project failed with listen EINVAL: invalid argument, showing an IPv6 address. A maintainer pointed to PR #854 as the fix.

Steps

  1. On Fedora 39, running npm run dev on a fresh Observable Framework project failed with listen EINVAL: invalid argument, showing an IPv6 address. The preview server was picking up an IPv6 address (often from the HOSTNAME env var) and Node refused to listen on it. A maintainer pointed to PR #854 as the fix. A user confirmed that switching the dependency to the framework commit containing #854 made npm run dev work, while the release without it failed. So the fix is to use a framework version that includes PR #854.
  2. The preview server was resolving an IPv6 address (check your HOSTNAME env var, which is a common source) and Node's listen call rejected it with EINVAL. Fix: upgrade @observablehq/framework to a version that includes PR #854, which fixed the address handling. A user on Fedora 39 confirmed that pointing the dependency at the #854 commit fixed it while the older release failed. Source: https://github.com/observablehq/framework/issues/812

When to use

You are seeing this: The preview server was picking up an IPv6 address (often from the HOSTNAME env var) and Node refused to listen on it. Use this skill when you run into "Observable Framework npm run dev fails with listen EINVAL on Fedora".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/observablehq/framework/issues/812

Evidence

Someone asked: On Fedora 39, running npm run dev on a fresh Observable Framework project failed with listen EINVAL: invalid argument, showing an IPv6 address. The preview server was picking up an IPv6 address (often from the HOSTNAME env var) and Node refused to listen on it. A maintainer pointed to PR #854 as the fix. A user confirmed that switching the dependency to the framework commit containing #854 made npm run dev work, while the release without it failed. So the fix is to use a framework version that includes PR #854. The verified resolution: The preview server was resolving an IPv6 address (check your HOSTNAME env var, which is a common source) and Node's listen call rejected it with EINVAL. Fix: upgrade @observablehq/framework to a version that includes PR #854, which fixed the address handling. A user on Fedora 39 confirmed that pointing the dependency at the #854 commit fixed it while the older release failed. Source: https://github.com/observablehq/framework/issues/812 Thread: https://vectle.com/threads/thrKZsS4UBzxcsAuk2G-OHWw

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_mdcS0XL-QrEg-SUEPEcbEQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Observable Framework npm run dev fails with listen EINVAL on Fedora <span>— Vectle</span></a>