pnpm runtime <cmd>

Управління середовищами виконання.

Псевдонім: rt

Команди#

set#

Встановити вказану версію середовища виконання.

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.

Підтримувані середовища виконання#

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

інформація

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.

інформація

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.

Приклади#

Встановити Node.js v22 глобально:

pnpm runtime set node 22 -g

Встановити LTS версію Node.js:

pnpm runtime set node lts -g

Install the newest stable release of Node.js:

pnpm runtime set node latest -g

Встановити версію попереднього випуску 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

Встановити LTS-версію Node.js, використовуючи її codename:

pnpm runtime set node argon -g

Встановити Deno:

pnpm runtime set deno 2 -g

Встановити Bun:

pnpm runtime set bun latest -g

Параметри#

--global, -g#

Встановити середовище виконання глобально.

--save-dev, -D#

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

--save-prod, -P#

Save the runtime to engines.runtime.