Translate a command between npm, pnpm, yarn and bun, with a note wherever the managers genuinely differ in behaviour rather than only in spelling.
pnpm-lock.yamlWaiting for a command
One per line. 20 operations are covered in every direction.
The translation appears here
Paste commands from any of the four managers.
A translated command is not always an equivalent one. npm ci deletes node_modules first and the others do not. pnpm's install is strict about dependencies a package uses but does not declare, so a project that installs cleanly under npm can fail under pnpm — usually for a real reason. Where the behaviour differs rather than the spelling, the note above says so.
Package Manager Converter runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
Most converters treat this as a spelling exercise, and it is not. `npm ci` deletes node_modules before installing and the others do not. pnpm's install is strict about dependencies a package uses but does not declare, so a project that installs cleanly under npm can fail under pnpm — usually for a real reason that npm's flat node_modules was hiding. Yarn Berry removed global installs altogether. Where the behaviour differs rather than the name, there is a note saying so.
The arguments are carried across by name rather than by position, which is what makes the workspace commands work. `npm install react --workspace web` and `pnpm --filter web add react` carry the same two values in the opposite order; a converter that substitutes positionally either gets them backwards or drops one.
The lockfile for each manager is shown alongside, because switching managers means deleting one lockfile and generating another, and leaving the old one in the repository is how a CI job ends up installing something different from your laptop.
A command with no equivalent is reported as having none rather than being approximated. An uncommon flag combination that nearly maps is the kind of thing that produces a command which runs and does the wrong thing, which is worse than one that fails.
Not quite, and the difference is deliberate. pnpm's node_modules is not flat, so a package can only import what it actually declares. npm's flat layout lets a package import a transitive dependency by accident, and that code breaks under pnpm — which is pnpm telling you about a real missing dependency rather than being awkward.
`pnpm install --frozen-lockfile`. Both fail rather than updating the lockfile when it is out of date, which is what you want in CI. npm ci additionally deletes node_modules first; pnpm does not, because its content-addressed store makes a clean install cheap anyway.
Because `npm run build --watch` passes --watch to npm rather than to your script. The bare `--` stops npm reading the rest. pnpm and yarn pass unrecognised flags through, which is why `pnpm build --watch` just works and is the single most common npm papercut.
You can, and it is a reliable way to get different dependency trees on different machines. Pick one manager, delete the others' lockfiles, and add a `packageManager` field to package.json so corepack enforces it.
It is reported as having none. An uncommon flag combination that nearly maps is the kind of thing that produces a command which runs and quietly does something else.