{"record":{"id":"c8dfb7730065778b","repo":"paperclipai/paperclip","slug":"choose-either-canary-or-version-not-both","errorCode":null,"errorMessage":"Choose either --canary or --version, not both.","messagePattern":"Choose either --canary or --version, not both\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/install.ts","lineNumber":97,"sourceCode":"    visited.add(packageName);\n    ordered.push(entry);\n  };\n\n  visit(\"@paperclipai/server\");\n  return ordered;\n}\n\nexport function assertSupportedNodeVersion(): void {\n  if (!isSupportedNodeVersion(process.versions.node)) {\n    throw new Error(`Installing or updating Paperclip requires Node.js ${MINIMUM_NODE_VERSION} or newer (found ${process.version} at ${process.execPath}). Put a supported Node bin directory first on PATH and run 'npx paperclipai@latest install --yes' to re-pin an existing managed install.`);\n  }\n}\n\nexport function resolveNpmInstallRequest(options: InstallOptions): {\n  spec: string;\n  channel: InstallChannel;\n} {\n  if (options.canary && options.version) throw new Error(\"Choose either --canary or --version, not both.\");\n  if (options.version) {\n    const version = options.version.trim();\n    if (!EXACT_VERSION_PATTERN.test(version)) {\n      throw new Error(`--version requires an exact published version, received '${options.version}'.`);\n    }\n    return { spec: version, channel: \"pinned\" };\n  }\n  return options.canary ? { spec: \"canary\", channel: \"canary\" } : { spec: \"latest\", channel: \"latest\" };\n}\n\nfunction parseResolvedVersion(stdout: string): string {\n  const trimmed = stdout.trim();\n  if (!trimmed) throw new Error(\"npm returned an empty version response.\");\n  try {\n    const parsed = JSON.parse(trimmed) as unknown;\n    if (typeof parsed === \"string\") return parsed;\n  } catch {\n    if (EXACT_VERSION_PATTERN.test(trimmed)) return trimmed;","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/install.ts#L79-L115","documentation":"Mutually-exclusive channel selection guard in the npm install request resolver: the CLI's managed installer supports exactly one install channel per invocation, and the caller passed both the --canary dist-tag flag and an explicit --version pin. The request is rejected before any npm command runs.","triggerScenarios":"Thrown at cli/src/commands/install.ts:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only one of --canary or --version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}