{"record":{"id":"9a35e6102b59293d","repo":"denoland/deno","slug":"module-could-not-be-found","errorCode":null,"errorMessage":"module could not be found","messagePattern":"module could not be found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/info.rs","lineNumber":610,"sourceCode":"          writer,\n          \"{} {} unique\",\n          colors::bold(\"dependencies:\"),\n          dep_count,\n        )?;\n        writeln!(\n          writer,\n          \"{} {}\",\n          colors::bold(\"size:\"),\n          display::human_size(total_size),\n        )?;\n        writeln!(writer)?;\n        let root_node = self.build_module_info(root, false);\n        root_node.print(writer)?;\n        Ok(())\n      }\n      Err(err) => {\n        if let ModuleErrorKind::Missing { .. } = err.as_kind() {\n          bail!(\"module could not be found\");\n        } else {\n          bail!(\"{:#}\", err);\n        }\n      }\n      Ok(None) => {\n        bail!(\"an internal error occurred\");\n      }\n    }\n  }\n\n  fn build_dep_info(&mut self, dep: &Dependency) -> Vec<DisplayTreeNode> {\n    let mut children = Vec::with_capacity(2);\n    if !dep.maybe_code.is_none()\n      && let Some(child) = self.build_resolved_info(&dep.maybe_code, false)\n    {\n      children.push(child);\n    }\n    if !dep.maybe_type.is_none()","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/info.rs#L592-L628","documentation":"`deno info <specifier>` resolved the root specifier, but the graph lookup returned ModuleErrorKind::Missing — the module itself could not be loaded: the file does not exist at the resolved path, or a remote (http/https) module was never cached and fetching failed. The root of the dependency tree is absent, so there is nothing to display.","triggerScenarios":"`deno info ./does_not_exist.ts`; `deno info https://example.com/mod.ts` while offline with an empty DENO_DIR cache; running info from a different cwd so a relative specifier resolves to a missing path; the remote module was deleted or renamed upstream.","commonSituations":"Typos in the path; running `deno info` from the wrong directory; first-ever run on a machine with no cache and no network; a CDN URL that moved.","solutions":["Verify the specifier exists (ls the file, or curl the URL)","For remote modules, cache it first with network access: `deno cache <url>` or `deno install`, then retry `deno info <url>`","Fix the path — run from the project root or use a specifier relative to the correct cwd"],"exampleFix":"# before\ndeno info ./src/main.ts   # run from wrong cwd -> module could not be found\n\n# after\ncd /path/to/project && deno info src/main.ts\n# or, for a remote module that was never cached:\ndeno cache https://example.com/mod.ts && deno info https://example.com/mod.ts","handlingStrategy":"validation","validationCode":"# local file: assert existence first\ntest -f src/main.ts && deno info src/main.ts\n# remote module: pre-cache with network before offline info\ndeno cache https://example.com/mod.ts && deno info https://example.com/mod.ts","typeGuard":null,"tryCatchPattern":"Wrap `deno info <spec>`; on 'module could not be found' check existence (fs stat or curl -I), re-cache remote specifiers (`deno cache <url>`), then retry once.","preventionTips":["Run info from the project root so relative specifiers resolve","Cache remote deps (`deno install`/`deno cache`) before offline work","Double-check specifier spelling and the module still exists upstream"],"tags":["info","module-resolution","missing-file","cache","specifier"],"backgroundTag":"module-not-found","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}