vercel/turborepo · warning · ConvertError

package_manager-already_in_use

package_manager-already_in_use

Error message

You are already using this package manager

What it means

The turbo-workspaces conversion entrypoint refuses a no-op: if the project's detected package manager already equals the target (convertTo.name) and options.ignoreUnchangedPackageManager is not set, it throws ConvertError type package_manager-already_in_use. This protects against 'converting' npm to npm, which would at best reinstall and at worst corrupt lockfiles.

Solutions

  1. Compare detected manager vs target before converting; skip if equal
  2. If you truly want to force it (e.g. to regenerate configs), pass options.ignoreUnchangedPackageManager = true
  3. If detection was wrong, remove the stray lockfile/packageManager field of the target manager and re-detect
  4. Check project.packageManager comes from devEngines.packageManager/packageManager or the lockfile you expect

Example fix

// before
await convert({ project, convertTo: npmDetails, logger }); // project is already npm -> throws

// after
if (project.packageManager !== convertTo.name) {
  await convert({ project, convertTo, logger });
} else {
  await convert({ project, convertTo, logger, options: { ignoreUnchangedPackageManager: true } });
}
Defensive patterns

Strategy: validation

Validate before calling

// Skip no-op conversions before calling convert
function isConversionNeeded(project: Project, convertToName: string): boolean {
  return project.packageManager !== convertToName;
}
// if (isConversionNeeded(project, target.name)) await convert(...);

Try / catch

try {
  await convert({ project, convertTo, logger, options });
} catch (err) {
  if (err instanceof ConvertError && err.type === "package_manager-already_in_use") {
    return; // desired end-state already true - treat as success
  }
  throw err;
}

Prevention

When it happens

Trigger: Invoking convert with the same source and target manager (e.g. detected npm -> convert to npm), or when detection picked the manager you are converting to because a stray lockfile or packageManager field for it exists in the repo.

Common situations: Automated migration scripts that do not compare the current manager before calling convert, repos with a leftover lockfile from the target manager (e.g. a committed bun.lockb while still on npm) making detection report the wrong current manager, or CI reruns of a conversion step.

Related errors


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

Appendix: source

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

*/
export async function convertProject({
  project,
  convertTo,
  logger,
  options
}: {
  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

View on GitHub (pinned to f9245100cf)