denoland/deno · error

workspace root is not a local directory

Error message

workspace root is not a local directory

What it means

Error "workspace root is not a local directory" thrown in denoland/deno.

Source

Thrown at cli/tools/installer/local.rs:273

) -> Result<(), AnyError> {
  use crate::args::TsTypeLib;
  use crate::graph_container::CollectSpecifiersOptions;

  let factory = CliFactory::from_flags(flags);
  let cli_options = factory.cli_options()?;
  let file_fetcher = factory.file_fetcher()?.clone();
  let http_client = factory.http_client_provider().get_or_create()?;
  let permissions = factory.root_permissions_container()?.clone();

  // Generate at the workspace/config root, not the current working directory,
  // so running `deno sync-types` from a subdirectory still writes the config
  // next to deno.json and picks up the root import map.
  let project_root = cli_options
    .workspace()
    .root_dir_url()
    .to_file_path()
    .map_err(|_| {
      deno_core::anyhow::anyhow!("workspace root is not a local directory")
    })?;

  let has_explicit_roots = !sync_types_flags.roots.is_empty();
  let root_patterns = if has_explicit_roots {
    sync_types_flags.roots
  } else {
    vec![".".to_string()]
  };

  // Build the module graph over either the requested roots or the whole
  // project to discover every external (npm:/jsr:/http(s):) specifier the code
  // actually uses — including specifiers written directly in source and across
  // workspace members, not just those declared in the root import map.
  let (graph_specifiers, local_wasm_modules) = {
    let graph_container = factory.main_module_graph_container().await?;
    let roots = graph_container.collect_specifiers(
      &root_patterns,
      CollectSpecifiersOptions {

View on GitHub (pinned to 89f33cbef2)

When it happens

Trigger: Thrown at cli/tools/installer/local.rs:273 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of denoland/deno@89f33cbef2 (2026-08-16). Data as JSON: /api/errors/ab4947a2e02951ca. Report an issue: GitHub.