{"record":{"id":"f810817be8efabff","repo":"denoland/deno","slug":"deno-ci-requires-a-lockfile-but-none-was-found","errorCode":null,"errorMessage":"deno ci requires a lockfile, but none was found.\n  hint: run `deno install` to create one.","messagePattern":"deno ci requires a lockfile, but none was found\\.\n  hint: run `deno install` to create one\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/installer/local.rs","lineNumber":203,"sourceCode":"  let npm_resolver = factory.npm_resolver().await?;\n  print_install_report(\n    &factory.sys(),\n    start_instant.elapsed(),\n    &install_reporter,\n    workspace,\n    npm_resolver,\n  );\n\n  Ok(())\n}\n\npub async fn ci_command(\n  flags: Arc<Flags>,\n  ci_flags: CiFlags,\n) -> Result<(), AnyError> {\n  let factory = CliFactory::from_flags(flags.clone());\n  if factory.maybe_lockfile().await?.is_none() {\n    bail!(\n      \"deno ci requires a lockfile, but none was found.\\n  hint: run `deno install` to create one.\"\n    );\n  }\n  if let Some(node_modules_dir) = factory.node_modules_dir_path()?\n    && node_modules_dir.exists()\n  {\n    log::info!(\n      \"{} {}\",\n      deno_terminal::colors::gray(\"Removing\"),\n      node_modules_dir.display()\n    );\n    std::fs::remove_dir_all(node_modules_dir).map_err(|err| {\n      deno_core::anyhow::anyhow!(\n        \"failed to remove {}: {err}\",\n        node_modules_dir.display()\n      )\n    })?;\n  }","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/installer/local.rs#L185-L221","documentation":"`deno ci` is the deterministic-install command: it reads deno.lock and installs exactly what the lockfile pins. It refuses to run when no lockfile exists, because there is nothing to verify against — the whole point of `ci` is lockfile-driven reproducibility.","triggerScenarios":"Running `deno ci` in a project where deno.lock has not been created yet — e.g. no `deno install` has ever run there, the lockfile is gitignored, or you are in a fresh clone of a repo that doesn't commit deno.lock.","commonSituations":"CI pipelines (GitHub Actions) on repos whose contributors never generated a lockfile; .gitignore entries that exclude deno.lock; fresh checkouts after adding new dependencies without running install.","solutions":["Run `deno install` locally to generate/refresh deno.lock","Commit deno.lock to the repository so `deno ci` has input in every environment","Remove deno.lock from .gitignore if reproducible installs are wanted"],"exampleFix":"# before\ndeno ci   # deno ci requires a lockfile, but none was found.\n\n# after\ndeno install   # creates deno.lock\ngit add deno.lock && git commit -m \"chore: add lockfile\"\ndeno ci","handlingStrategy":"validation","validationCode":"# in CI, guarantee the lockfile exists before deno ci:\ntest -f deno.lock || { deno install; git add deno.lock; }\ndeno ci","typeGuard":null,"tryCatchPattern":"On 'deno ci requires a lockfile': run `deno install` to generate it, commit it, then retry `deno ci` — a deterministic pipeline step.","preventionTips":["Commit deno.lock and never gitignore it when using `deno ci`","Run `deno install` after adding dependencies so the lockfile stays current","Add a CI guard ('test -f deno.lock') before the ci step to fail with a clear message"],"tags":["ci","lockfile","install","reproducibility"],"backgroundTag":"missing-lockfile","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"}