Langsung ke konten utama
Versi: 10.x

pnpm env <cmd>

Mengelola lingkungan Node.js.

danger

pnpm env does not include the binaries for Corepack. If you want to use Corepack to install other package managers, you need to install it separately (e.g. pnpm add -g corepack).

Perintah

use

Instal dan menggunakan versi Node.js yang ditentukan

Instal Node.js versi LTS:

pnpm env use --global lts

Instal Node.js v16:

pnpm env use --global 16

Instal Node.js versi pra-rilis:

pnpm env use --global nightly
pnpm env use --global rc
pnpm env use --global 16.0.0-rc.0
pnpm env use --global rc/14

Instal Node.js versi terbaru:

pnpm env use --global latest

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

pnpm env use --global argon

add

Installs the specified version(s) of Node.js without activating them as the current version.

Contoh:

pnpm env add --global lts 18 20.0.1

remove, rm

Removes the specified version(s) of Node.js.

Usage example:

pnpm env remove --global 14.0.0
pnpm env remove --global 14.0.0 16.2.3

list, ls

List Node.js versions available locally or remotely.

Print locally installed versions:

pnpm env list

Print remotely available Node.js versions:

pnpm env list --remote

Print remotely available Node.js v16 versions:

pnpm env list --remote 16

Pengaturan

--global, -g

The changes are made systemwide.