{"record":{"id":"a5c7c5764b2212e9","repo":"denoland/deno","slug":"installation-rejected","errorCode":null,"errorMessage":"Installation rejected","messagePattern":"Installation rejected","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"cli/tools/x.rs","lineNumber":910,"sourceCode":"    XTempDir::New(temp_dir) => {\n      let confirmed = yes\n        || match confirm(ConfirmOptions {\n          default: true,\n          message: format!(\"Install {}?\", req_ref),\n        }) {\n          Some(true) => true,\n          Some(false) => false,\n          None if !DrawThread::is_supported() => {\n            log::warn!(\n              \"Unable to prompt, installing {} without confirmation\",\n              req_ref.req()\n            );\n            true\n          }\n          None => false,\n        };\n      if !confirmed {\n        return Err(anyhow::anyhow!(\"Installation rejected\"));\n      }\n      match req_ref {\n        ReqRef::Npm(req_ref) => {\n          let pkg_json = temp_dir.join(\"package.json\");\n          std::fs::write(\n            &pkg_json,\n            format!(\n              \"{{\\\"dependencies\\\": {{\\\"{}\\\": \\\"{}\\\"}} }}\",\n              req_ref.req().name,\n              req_ref.req().version_req\n            ),\n          )?;\n        }\n        ReqRef::Jsr(req_ref) => {\n          let deno_json = temp_dir.join(\"deno.json\");\n          let mut imports = serde_json::Map::new();\n          imports.insert(\n            req_ref.req().name.to_string(),","sourceCodeStart":892,"sourceCodeEnd":928,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/x.rs#L892-L928","documentation":"Before `deno x` materializes a package into its temp dir it asks `Install <req>?`. Declining the prompt (or an aborted prompt on a terminal where the draw thread is supported) returns 'Installation rejected'. A truthy `--yes` flag skips the question; unsupported terminals auto-proceed with a warning.","triggerScenarios":"Answering 'n' at the `Install <package>?` confirmation during `deno x`, or interrupting the prompt so it yields no answer on a supported terminal.","commonSituations":"Interactive use where the user changes their mind; scripted runs inside a capable terminal that receive EOF instead of a confirmation.","solutions":["Re-run and accept the prompt — the default is yes, so pressing Enter is enough","For scripts and CI, pass --yes so no prompt appears: `deno x --yes <pkg>`","If the prompt is surprising, inspect the package requirement first, then confirm deliberately"],"exampleFix":"# before\ndeno x some-pkg   # then answer 'n' at the prompt\n# after\ndeno x --yes some-pkg","handlingStrategy":"validation","validationCode":"# scripts and CI: skip the interactive prompt entirely\ndeno x --yes some-pkg --flag arg","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass --yes in non-interactive or scripted environments","Feed Enter (the default answer is yes) when prompted interactively","Pin the package requirement so the confirmation names exactly what you audited"],"tags":["cli","deno-x","prompt","installation"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}