LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

bun-pm-migrate

Migrate from another package manager to Bun

TLDR

Migrate from npm/yarn/pnpm to Bun
$ bun pm migrate
copy
Force migration when a bun.lock already exists
$ bun pm migrate --force
copy

SYNOPSIS

bun pm migrate [options]

DESCRIPTION

bun pm migrate converts a project from npm, yarn, or pnpm to use Bun's package manager. It reads an existing lockfile (package-lock.json, yarn.lock, or pnpm-lock.yaml) and creates a bun.lock file, preserving the resolved dependency versions from the original lockfile.Note that `bun install` also performs automatic lockfile migration when no bun.lock exists, so this command is primarily useful for explicit one-time migration without installing packages.

PARAMETERS

-f, --force

Overwrite an existing bun.lock lockfile.

CAVEATS

Review the generated bun.lock to ensure dependency resolution matches expectations. Some edge cases with complex dependency trees may require manual adjustment. The original lockfile is preserved and can be removed manually after verification.

SEE ALSO

bun(1), bun-pm(1), bun-install(1), npm(1), yarn(1), pnpm(1)

Copied to clipboard
Kai