{"record":{"id":"4588f2de1cfb0033","repo":"pnpm/pnpm","slug":"runtime-unknown-subcommand","errorCode":"RUNTIME_UNKNOWN_SUBCOMMAND","errorMessage":"Unknown subcommand: ${params[0]}","messagePattern":"Unknown subcommand: (.+?)","errorType":"exception","errorClass":"PnpmError","httpStatus":null,"severity":"error","filePath":"pnpm11/engine/runtime/commands/src/runtime/runtime.ts","lineNumber":94,"sourceCode":"      'pnpm runtime set deno 2 -g',\n      'pnpm runtime set bun latest -g',\n    ],\n  })\n}\n\nexport async function handler (opts: RuntimeCommandOptions, params: string[]): Promise<void> {\n  if (params.length === 0) {\n    throw new PnpmError('RUNTIME_NO_SUBCOMMAND', 'Please specify the subcommand', {\n      hint: help(),\n    })\n  }\n  switch (params[0]) {\n    case 'set': {\n      runtimeSet(opts, params.slice(1))\n      return\n    }\n    default: {\n      throw new PnpmError('RUNTIME_UNKNOWN_SUBCOMMAND', `Unknown subcommand: ${params[0]}`, {\n        hint: help(),\n      })\n    }\n  }\n}\n\nfunction runtimeSet (opts: RuntimeCommandOptions, params: string[]): void {\n  const runtimeName = params[0]?.trim()\n  if (!runtimeName) {\n    throw new PnpmError('MISSING_RUNTIME_NAME', '\"pnpm runtime set <name> <version>\" requires a runtime name (e.g. node, deno, bun)')\n  }\n  // The runtime name is interpolated into an `add` selector, so reject\n  // anything that isn't a known runtime before it can be misread as a\n  // comma-separated package list or a local path by the install pipeline.\n  if (!isRuntimeAlias(runtimeName)) {\n    throw new PnpmError('INVALID_RUNTIME_NAME', `\"${runtimeName}\" is not a supported runtime. Supported runtimes are: ${RUNTIME_NAMES.join(', ')}`)\n  }\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/pnpm/pnpm/blob/5b11d3a15b9022a2109cb18ed96a5d652630371f/pnpm11/engine/runtime/commands/src/runtime/runtime.ts#L76-L112","documentation":"The runtime handler's switch only recognizes `set`; any other first parameter hits the default branch and throws RUNTIME_UNKNOWN_SUBCOMMAND with the offending value interpolated into the message plus a help hint. Unlike the no-subcommand case, this names what you passed, making typos obvious. The supported surface is intentionally small while the command is young.","triggerScenarios":"`pnpm runtime list`, `pnpm runtime use`, `pnpm runtime remove` — anything besides `set`; also tab-completed guesses imported from the env/nvm vocabulary.","commonSituations":"Assuming runtime mirrors env's subcommands; migrating scripts from `pnpm env` and forgetting to rename the verb; typos like `st`.","solutions":["Use the only implemented subcommand: `pnpm runtime set <name> <version>`.","For listing, keep using `pnpm env list` until runtime grows a list command.","Read the included hint for the exact accepted forms."],"exampleFix":"# before\npnpm runtime list   # ERR_PNPM_RUNTIME_UNKNOWN_SUBCOMMAND: Unknown subcommand: list\n# after\npnpm runtime set node 22 -g\npnpm env list   # listing still lives here","handlingStrategy":"validation","validationCode":"const KNOWN_RUNTIME_SUBCOMMANDS = new Set(['set'])\nexport function isKnownRuntimeSubcommand (sub: string): boolean {\n  return KNOWN_RUNTIME_SUBCOMMANDS.has(sub)\n}","typeGuard":"const RUNTIME_SUBCOMMANDS = ['set'] as const\ntype RuntimeSubcommand = typeof RUNTIME_SUBCOMMANDS[number]\nfunction isRuntimeSubcommand (value: string): value is RuntimeSubcommand {\n  return (RUNTIME_SUBCOMMANDS as readonly string[]).includes(value)\n}","tryCatchPattern":null,"preventionTips":["Whitelist the subcommand before invoking; fail fast in wrappers on unknown verbs.","Keep listing on `pnpm env list` until runtime grows its own list subcommand."],"tags":["cli","runtime-command","usage","dispatch"],"backgroundTag":null,"analyzedSha":"5b11d3a15b9022a2109cb18ed96a5d652630371f","analyzedAt":"2026-08-16T13:18:59.198Z","schemaVersion":2},"datasetVersion":"2026-08-16T18:17:16.020Z"}