denoland/deno · error

An executable name was not provided. One could not be…

Error message

An executable name was not provided. One could not be inferred from the URL. Aborting.

What it means

`deno compile` needs a name for the produced binary. If `--output`/`-o` is not given, Deno infers one from the module URL's last path segment. When the URL yields no usable name — it ends in '/', or is a data: URL — inference fails and compilation aborts before doing work.

Solutions

  1. Pass an explicit name: `deno compile --output=myapp <url>` (short form `-o myapp`)
  2. If the URL was truncated or wrong, fix it so the last segment is a real filename
  3. For install-style flows, prefer `deno install`, which records an explicit command name

Example fix

# before
deno compile https://example.com/

# after
deno compile --output myapp https://example.com/
Defensive patterns

Strategy: validation

Validate before calling

// Wrapper: ensure a name can be inferred, else pass --output explicitly
const url = Deno.args.at(-1) ?? "";
let last = "";
try {
  last = new URL(url).pathname.split("/").at(-1) ?? "";
} catch {
  last = url.split("/").at(-1) ?? "";
}
const inferable = last.length > 0 && !url.startsWith("data:");
if (!inferable && !Deno.args.some((a) => a.startsWith("--output") || a === "-o")) {
  throw new Error(`cannot infer a name from ${url} — pass --output <name>`);
}

Prevention

When it happens

Trigger: `deno compile https://example.com/` (no filename in the URL), `deno compile` on a `data:` URL, or any module specifier whose last segment is empty — all without `--output`.

Common situations: Compiling web-installed CLIs whose install URL lacks a filename; CI scripts that compile generated or templated URLs without naming the artifact.

Related errors


AI-assisted analysis of denoland/deno@f7822238ca (2026-08-20). Data as JSON: /api/errors/a349b7e81085eba7. Report an issue: GitHub.

Appendix: source

Thrown at cli/tools/compile.rs:1313

      {
        out_path = out_path.join(infer_file_name);
      }
    } else {
      out_path = out_path.to_path_buf();
    }
    Some(out_path)
  } else {
    None
  };

  if output_flag.is_none() {
    output_path = bin_name_resolver
      .infer_name_from_url(&module_specifier)
      .await
      .map(PathBuf::from)
  }

  output_path.ok_or_else(|| anyhow!(
    "An executable name was not provided. One could not be inferred from the URL. Aborting.",
  )).map(|output_path| {
    if is_desktop {
      get_desktop_specific_filepath(output_path, &compile_flags.target)
    } else {
      get_os_specific_filepath(output_path, &compile_flags.target)
    }
  })
}

fn get_desktop_specific_filepath(
  output: PathBuf,
  target: &Option<String>,
) -> PathBuf {
  let is_windows = match target {
    Some(target) => target.contains("windows"),
    None => cfg!(windows),
  };

View on GitHub (pinned to f7822238ca)