vercel/turborepo · error · ConvertError

package_manager-could_not_be_found

package_manager-could_not_be_found

Error message

${convertTo.name} is not installed, or could not be located

What it means

convert requires the target package manager to be resolvable on the machine: convertTo.version is populated only when the binary was located (version detection). If it is missing, conversion aborts with ConvertError type package_manager-could_not_be_found, because later steps must run the target manager's install command.

Solutions

  1. Install the target manager: corepack enable && corepack prepare pnpm@latest --activate (or npm i -g pnpm / curl -fsSL https://bun.sh/install | bash)
  2. Verify from the same shell/environment: <pm> --version resolves
  3. If using a version manager (volta, asdf, mise), ensure its shims are on PATH for the process calling convert
  4. On CI, add the install step before the convert step

Example fix

# before
npx @turbo/workspaces convert --to pnpm # pnpm not installed -> throws

# after
npm i -g pnpm && pnpm --version
npx @turbo/workspaces convert --to pnpm
Defensive patterns

Strategy: validation

Validate before calling

import { execa } from "execa";

async function managerInstalled(name: string): Promise<boolean> {
  try {
    await execa(name, ["--version"]);
    return true;
  } catch {
    return false;
  }
}
// if (!(await managerInstalled(target.name))) install or abort before convert;

Try / catch

try {
  await convert({ project, convertTo, logger });
} catch (err) {
  if (err instanceof ConvertError && err.type === "package_manager-could_not_be_found") {
    throw new Error(`Install ${convertTo.name} first (corepack or global install)`, { cause: err });
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling convert with a convertTo whose binary is not installed or not on PATH (e.g. converting to yarn/pnpm/bun without it installed), the binary existing only under a name not probed, or PATH being minimal (cron, stripped CI containers) so which/execa cannot find it.

Common situations: CI images that preinstall npm but not pnpm/bun, converting on a machine where the target was installed via a version manager that is not on PATH for the current shell, Windows where the .cmd shim is missing, or corepack not enabled for yarn/pnpm.

Related errors


AI-assisted analysis of vercel/turborepo@f9245100cf (2026-08-17). Data as JSON: /api/errors/3a180d03a1185f56. Report an issue: GitHub.

Appendix: source

Thrown at packages/turbo-workspaces/src/convert.ts:47

}: {
  project: Project;
  convertTo: RequestedPackageManagerDetails;
  logger: Logger;
  options?: Options;
}) {
  logger.header(
    `Converting project from ${project.packageManager} to ${convertTo.name}.`
  );

  if (!options?.ignoreUnchangedPackageManager) {
    if (project.packageManager === convertTo.name) {
      throw new ConvertError("You are already using this package manager", {
        type: "package_manager-already_in_use"
      });
    }

    if (!convertTo.version) {
      throw new ConvertError(
        `${convertTo.name} is not installed, or could not be located`,
        {
          type: "package_manager-could_not_be_found"
        }
      );
    }
  }

  // this cast is safe since we've just verified that the version exists above
  const to = convertTo as AvailablePackageManagerDetails;

  // remove old workspace data
  if (!options?.ignoreUnchangedPackageManager) {
    await MANAGERS[project.packageManager].remove({
      project,
      to,
      logger,
      options

View on GitHub (pinned to f9245100cf)