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.

Ejemplos#

Install Node.js v22 globally:

pnpm runtime set node 22 -g

Instalar la versión LTS de Node.js:

pnpm runtime set node lts -g

Install the newest stable release of Node.js:

pnpm runtime set node latest -g

Instalar una versión pre-lanzamiento de 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

unset#

Remove a runtime installed by runtime set.

pnpm runtime unset <name> [-g]

Without -g, pnpm removes the runtime dependency from the current project. A declaration must use the runtime: or tool: protocol; an ordinary dependency with the same name is left in place. Without --save-dev or --save-prod, pnpm removes the runtime from both devEngines.runtime and engines.runtime. With -g, pnpm removes the global install of the runtime and unlinks its bins. For Node.js, pnpm also removes the Node.js versions installed by pnpm env use -g and their active link. The runtime files stay in the store until pnpm store prune, so projects that use the runtime keep working.

Ejemplos#

Unset the global Node.js:

pnpm runtime unset node -g

Unset Deno from the current project:

pnpm runtime unset deno

Opciones#

--global, -g#

Apply the command to globally installed runtimes.

--save-dev, -D#

Target devEngines.runtime. This is the default for set.

--save-prod, -P#

Target engines.runtime.