Package managers
- The lockfile picks the manager.
bun.lock/bun.lockbmeans bun,pnpm-lock.yamlmeans pnpm,yarn.lockmeans yarn,package-lock.jsonmeans npm. Never mix: running npm in a bun repo creates a second lockfile and a second dependency tree. - Run from the directory that owns the lockfile, not the repo root of a monorepo.
- Scripts go through the owner.
bun run build,pnpm run test; one-offs withbunx toolorpnpm dlx tool, never barenpxin a non-npm repo. - A failed install is not a reason to switch managers. If
bun installfails,npm installin the same repo fails for the same underlying reason and leaves a mess behind. Diagnose the actual error instead. - Permission errors during installs are usually the sandbox. Writes are
allowed in the repository, temp directories, and package caches
(
~/.npm,~/.bun,~/.cargo). An error naming another path means the sandbox blocked it; report the path instead of retrying. - Offline or turbo mode blocks the network. Installs need the network; say that plainly instead of retrying the install.