{"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/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/x.rs#L731-L767","documentation":"For an npm package run via `deno x`, deno selects the `bin` entry matching the invoked command name (or the fallback name). When the package exposes multiple bins and none matches, it lists every available bin and errors instead of guessing.","triggerScenarios":"`deno x some-pkg` where some-pkg's package.json `bin` map has several entries and none matches the invoked name or the fallback.","commonSituations":"CLI packages that ship several executables; running the package by its name when the intended bin has a different name; case mismatches in bin names.","solutions":["Re-run with the explicit binary from the list: `deno x some-pkg/<bin-name>`","Copy the spelling exactly from the 'Available bins:' section — entries are case-sensitive","If you maintain the package, make sure package.json's bin map includes the command name users invoke"],"exampleFix":"# before\ndeno x some-pkg\n# after (pick a listed bin)\ndeno x some-pkg/some-pkg-cli","handlingStrategy":"validation","validationCode":"# bash: query the package's bin entries first and pass one explicitly\nbins=$(npm exec --package=some-pkg -- node -p \"Object.keys(require('./package.json').bin).join(' ')\" 2>/dev/null)\necho \"available bins: $bins\"\ndeno x \"some-pkg/$(echo $bins | awk '{print $1}')\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Invoke multi-bin packages as `<pkg>/<bin>` rather than by package name alone","Read the package's bin map when adding it to scripts","Treat the 'Available bins:' list in the error as the source of truth for spelling"],"tags":["cli","deno-x","npm","binaries"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}