{"record":{"id":"89608c5de1e4d1fe","repo":"denoland/deno","slug":"no-deno-json-found-in-current-directory","errorCode":null,"errorMessage":"No deno.json found in current directory","messagePattern":"No deno\\.json found in current directory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/pack/mod.rs","lineNumber":97,"sourceCode":"            \"Missing 'exports' field in '{}'. Add an exports field like:\\n  {{\\n    \\\"exports\\\": \\\"./mod.ts\\\",\\n    ...\\n  }}\",\n            deno_json.specifier\n          );\n        }\n\n        packages.push(JsrPackageConfig {\n          name,\n          member_dir: cli_options.start_dir.workspace.root_dir().clone(),\n          config_file: deno_json.clone(),\n          license: deno_json\n            .json\n            .license\n            .as_ref()\n            .and_then(|l| l.as_str().map(|s| s.to_string())),\n          should_publish: true,\n        });\n      }\n      None => {\n        bail!(\"No deno.json found in current directory\");\n      }\n    }\n  }\n\n  let module_graph_creator = cli_factory.module_graph_creator().await?;\n  let parsed_source_cache = cli_factory.parsed_source_cache()?;\n\n  for package in packages {\n    // Validate package name format\n    if !package.name.starts_with('@') || !package.name.contains('/') {\n      bail!(\n        \"Invalid package name '{}'. Package name must be in the format '@scope/name'\",\n        package.name\n      );\n    }\n\n    log::info!(\n      \"{} {}\",","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/pack/mod.rs#L79-L115","documentation":"`deno pack` found no JSR packages in the workspace and no deno.json in the current directory, so there is nothing to pack. This is the `None` arm of the member deno.json lookup: `jsr_packages_for_publish()` was empty and `member_deno_json()` returned None.","triggerScenarios":"Running `deno pack` in a directory with neither deno.json nor any publishable workspace member (e.g. a plain folder, a node-only project, or a subdirectory of the workspace).","commonSituations":"Running the command from the wrong directory (workspace root of a multi-member workspace where members hold the packages). A folder with only .ts files and no config; a package.json-only npm project. Intentionally initializing a package before creating config.","solutions":["Run `deno pack` from the directory that contains (or should contain) the package's deno.json.","Create a deno.json with name/version/exports in the current directory if this is the package root.","If packages live in workspace members, ensure each member deno.json has a `name` so they register as JSR packages."],"exampleFix":"# before: no config in cwd\ndeno pack\n# after: scaffold minimal config first\ncat > deno.json <<'EOF'\n{\n  \"name\": \"@scope/pkg\",\n  \"version\": \"1.0.0\",\n  \"exports\": \"./mod.ts\"\n}\nEOF\ndeno pack","handlingStrategy":"validation","validationCode":"import { existsSync } from \"node:fs\";\nif (!existsSync(\"deno.json\") && !existsSync(\"deno.jsonc\")) {\n  console.error(\"nothing to pack: create deno.json first\");\n  process.exit(1);\n}\ndeno pack;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run pack from the package directory, not arbitrary subfolders.","Keep one deno.json per publishable package with a `name` so workspace discovery finds it.","Fail fast in scripts when the expected config file is absent."],"tags":["pack","deno-json","discovery"],"backgroundTag":"missing-config-file","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T04:17:50.494Z"}