{"record":{"id":"3a180d03a1185f56","repo":"vercel/turborepo","slug":"package-manager-could-not-be-found","errorCode":"package_manager-could_not_be_found","errorMessage":"${convertTo.name} is not installed, or could not be located","messagePattern":"(.+?) is not installed, or could not be located","errorType":"exception","errorClass":"ConvertError","httpStatus":null,"severity":"error","filePath":"packages/turbo-workspaces/src/convert.ts","lineNumber":47,"sourceCode":"}: {\n  project: Project;\n  convertTo: RequestedPackageManagerDetails;\n  logger: Logger;\n  options?: Options;\n}) {\n  logger.header(\n    `Converting project from ${project.packageManager} to ${convertTo.name}.`\n  );\n\n  if (!options?.ignoreUnchangedPackageManager) {\n    if (project.packageManager === convertTo.name) {\n      throw new ConvertError(\"You are already using this package manager\", {\n        type: \"package_manager-already_in_use\"\n      });\n    }\n\n    if (!convertTo.version) {\n      throw new ConvertError(\n        `${convertTo.name} is not installed, or could not be located`,\n        {\n          type: \"package_manager-could_not_be_found\"\n        }\n      );\n    }\n  }\n\n  // this cast is safe since we've just verified that the version exists above\n  const to = convertTo as AvailablePackageManagerDetails;\n\n  // remove old workspace data\n  if (!options?.ignoreUnchangedPackageManager) {\n    await MANAGERS[project.packageManager].remove({\n      project,\n      to,\n      logger,\n      options","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/vercel/turborepo/blob/9f94a7d215b3881942527dd526afa3fc650869d5/packages/turbo-workspaces/src/convert.ts#L29-L65","documentation":"convertProject() requires the target package manager's version to be resolvable (convertTo.version). A missing version means the manager binary could not be located or interrogated, so it throws ConvertError type package_manager-could_not_be_found instead of shelling out to a command that does not exist.","triggerScenarios":"Targeting npm/pnpm/yarn/bun/nub/aube when the binary is not installed or not on PATH, so the version lookup that built the RequestedPackageManagerDetails produced no version. Bypassed only by options.ignoreUnchangedPackageManager.","commonSituations":"Converting to bun on a machine that never installed bun; CI images lacking the target manager; nvm/volta shims inactive in the current shell; Windows PATH missing the .cmd shim.","solutions":["Install the target manager (e.g. npm i -g pnpm, or bun's official installer) and confirm `<manager> --version` works in the same shell","Re-run the conversion after ensuring the binary is on PATH","If it is installed but undetected, fix PATH ordering or invoke the conversion from a shell where the manager resolves"],"exampleFix":"# before: bun not installed\nnpx @turbo/workspaces convert --to bun # 'bun is not installed...'\n\n# after\ncurl -fsSL https://bun.sh/install | bash\nbun --version # sanity check, then re-run","handlingStrategy":"validation","validationCode":"import { execSync } from \"node:child_process\";\n\nfunction managerVersion(command: string): string | undefined {\n  try {\n    return execSync(`${command} --version`, { stdio: \"pipe\" }).toString().trim();\n  } catch {\n    return undefined;\n  }\n}\n\nif (!managerVersion(convertTo.name)) {\n  throw new Error(`Install ${convertTo.name} before converting`);\n}","typeGuard":"function isManagerMissingError(e: unknown): boolean {\n  return e instanceof ConvertError && e.type === \"package_manager-could_not_be_found\";\n}","tryCatchPattern":"try {\n  await convertProject({ project, convertTo, logger });\n} catch (e) {\n  if (e instanceof ConvertError && e.type === \"package_manager-could_not_be_found\") {\n    // prompt: `pnpm not found — install it?` then retry after install\n  } else throw e;\n}","preventionTips":["Pre-flight check `<manager> --version` in conversion scripts","Install the target manager before running conversions in CI","Ensure the shell running the conversion has the manager's bin directory on PATH"],"tags":["package-manager","conversion","path","installation"],"backgroundTag":"package-manager-not-installed","analyzedSha":"9f94a7d215b3881942527dd526afa3fc650869d5","analyzedAt":"2026-08-16T19:47:29.531Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}