{"record":{"id":"6203c3cbb5a641fc","repo":"denoland/deno","slug":"unable-to-choose-binary-for-available-bins","errorCode":null,"errorMessage":"Unable to choose binary for {}\n  Available bins:\n{}","messagePattern":"Unable to choose binary for (.+?)\n  Available bins:\n(.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"cli/tools/x.rs","lineNumber":749,"sourceCode":"          None\n        };\n\n        if let Some(fallback_name) = fallback_name\n          && let Some(exit_code) = maybe_run_local_npm_bin(\n            &runner_factory,\n            &runner_flags,\n            runner_node_resolver,\n            runner_npm_resolver,\n            fallback_name.as_ref(),\n            &unstable_args,\n            &forwarded,\n          )\n          .await?\n        {\n          return Ok(exit_code);\n        }\n\n        Err(anyhow::anyhow!(\n          \"Unable to choose binary for {}\\n  Available bins:\\n{}\",\n          effective_command,\n          bin_commands\n            .keys()\n            .map(|k| format!(\"    {}\", k))\n            .collect::<Vec<_>>()\n            .join(\"\\n\")\n        ))\n      }\n    }\n    ReqRefOrUrl::Jsr(jsr_package_req_reference) => {\n      let (_new_flags, new_factory) = autoinstall_package(\n        ReqRef::Jsr(&jsr_package_req_reference),\n        &flags,\n        reload,\n        command_flags.yes,\n        &command_flags.ignore_scripts,\n        &factory.deno_dir()?.root,","sourceCodeStart":731,"sourceCodeEnd":767,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/x.rs#L731-L767","documentation":"After auto-installing an npm package for `deno x`, Deno must choose which `bin` to execute: first the subpath/package name (maybe_run_local_npm_bin at x.rs:708-717), then — only when the package exposes exactly one bin — that sole binary (x.rs:728-732). When the package has multiple bins and none matches the requested name, x.rs:749-757 fails and lists every available bin name.","triggerScenarios":"`deno x <multi-bin-package>` with no :binname suffix, where the package name differs from all of its bin entries (common for scoped packages whose bin names drop the @scope/).","commonSituations":"Scoped packages (@scope/pkg exposing bins pkg-cli and pkg-server); tools renamed their bins across major versions; running a package seen in docs without its subcommand suffix.","solutions":["Choose the binary explicitly with the subpath form: `deno x <pkg>:<binname>` — the error's list shows the valid names.","Install once and run the bin directly: `deno install -g <pkg>` then invoke <binname>.","Check the package's `bin` map on npmjs.com to confirm exact spelling and case."],"exampleFix":"# before\n$ deno x some-tool\nerror: Unable to choose binary for some-tool\n  Available bins:\n    some-tool-cli\n    some-tool-server\n\n# after — pick a bin via subpath\ndeno x some-tool:some-tool-cli --watch .","handlingStrategy":"validation","validationCode":"# Look up the package's bin map before invoking deno x\nnpm view <pkg> bin --json\n# if multiple entries, invoke with the subpath: deno x <pkg>:<chosen-bin>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["For multi-bin packages, always specify the binary: deno x pkg:binname.","Check the `bin` map (npm view <pkg> bin) when documenting invocations for a team.","Pre-install with deno install -g so the binary is callable by its own name."],"tags":["deno-x","npm","bin","cli"],"backgroundTag":"ambiguous-bin-entry","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}