pnpm runtime <cmd>

Manage runtimes.

Alias: rt

Commands#

set#

Install the specified version of a runtime.

pnpm runtime set <name> <version> [-g]

Without -g, the runtime is added to the current project as <name>@runtime:<version>. By default it goes to devEngines.runtime. With --save-prod, it goes to engines.runtime.

After installing, pnpm suggests running pnpm shim add <name> so that the bare command picks the project's runtime.

Supported runtimes#

  • node - Node.js
  • deno - Deno
  • bun - Bun

Info

Installing a Node.js runtime (via pnpm runtime set node … or node@runtime:<version>) does not install the bundled npm, npx, and corepack. If you need npm, install it separately with pnpm add -g npm.

Info

The release metadata of a Node.js version is cached in the cache directory after its signature is verified. A pinned runtime whose metadata was fetched once resolves without network access.

Examples#

Install Node.js v22 globally:

pnpm runtime set node 22 -g

Install the LTS version of Node.js:

pnpm runtime set node lts -g

Install the newest stable release of Node.js:

pnpm runtime set node latest -g

Install a prerelease version of Node.js:

pnpm runtime set node nightly -g
pnpm runtime set node rc -g
pnpm runtime set node rc/22 -g
pnpm runtime set node 22.0.0-rc.4 -g

Install an LTS version of Node.js using its codename:

pnpm runtime set node argon -g

Install Deno:

pnpm runtime set deno 2 -g

Install Bun:

pnpm runtime set bun latest -g

Options#

--global, -g#

Install the runtime globally.

--save-dev, -D#

Save the runtime to devEngines.runtime. This is the default.

--save-prod, -P#

Save the runtime to engines.runtime.