denoland/deno · error

remote deno.json files are not supported

Error message

remote deno.json files are not supported

What it means

The dependency manager (deno add/remove/install/outsider updates) builds its view from `from_workspace_dir` and requires the member deno.json to be a local `file:` URL. A deno.json loaded over http(s) cannot be discovered/edited on disk, so the operation refuses up front.

Source

Thrown at cli/tools/pm/deps.rs:695

      npm_resolver,
      npm_version_resolver,
      progress_bar,
      permissions_container,
      main_module_graph_container,
      lockfile,
      pending_changes: Vec::new(),
    }
  }

  pub fn from_workspace_dir(
    workspace_dir: &Arc<WorkspaceDirectory>,
    dep_filter: impl DepFilter,
    args: DepManagerArgs,
  ) -> Result<Self, AnyError> {
    let mut deps = Vec::with_capacity(256);
    if let Some(deno_json) = workspace_dir.member_deno_json() {
      if deno_json.specifier.scheme() != "file" {
        bail!("remote deno.json files are not supported");
      }
      let path = deno_json.specifier.to_file_path().unwrap();
      if path.parent().unwrap() == workspace_dir.dir_path() {
        add_deps_from_deno_json(deno_json, dep_filter, &mut deps);
      }
    }
    if let Some(package_json) = workspace_dir.member_pkg_json() {
      add_deps_from_package_json(package_json, dep_filter, &mut deps);
    }
    // Catalogs are a workspace-root concept, so only include them when running
    // in the root directory (the recursive path handles them via the workspace).
    if workspace_dir.dir_path() == workspace_dir.workspace.root_dir_path() {
      add_deps_from_catalogs(&workspace_dir.workspace, dep_filter, &mut deps);
    }

    Ok(Self::with_deps_args(deps, args))
  }

View on GitHub (pinned to 9ad36f7a2c)

Solutions

  1. Download the remote deno.json to the project and point --config at the local file.
  2. If only parts are remote, inline the needed pieces (imports/dependencies) into a local deno.json.
  3. Re-run the dependency command from the directory with the local config.

Example fix

# before
deno install --config https://example.com/deno.json
# after
curl -o deno.json https://example.com/deno.json
deno install --config ./deno.json
Defensive patterns

Strategy: validation

Validate before calling

import { isAbsolute } from "node:path";
const configArg = process.argv.find((a) => a.startsWith("--config="))?.slice(9);
if (configArg?.startsWith("http://") || configArg?.startsWith("https://")) {
  console.error("dependency commands need a local deno.json; download the config first");
  process.exit(1);
}

Prevention

When it happens

Trigger: Running `deno add`/`deno remove`/`deno install` with a remote config, e.g. `deno install --config https://example.com/deno.json`, or in a context where the workspace's member config specifier has an http/https scheme.

Common situations: Shared team configs served over HTTP; experimental setups pointing --config at a URL; proxies or tooling that inject remote deno.json.

Related errors


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