Skip to content
BENIBIX Learn

pnpm

Development🛠️ Editors & ToolsPackages

Also known as pnpm add, pnpm package manager

A tool that adds packages to JavaScript apps. It keeps one copy of each on your disk.

Think of it like

It is like one shared toy box for the whole street. Nobody keeps a second copy at home.

Example

Jack has 20 small projects that all use React. With pnpm, React sits on his disk once, and every project points to it.

Why it matters

Big projects pull in thousands of packages. Sharing one copy saves gigabytes and makes installs quicker.

Definition

pnpm is a free package manager for JavaScript that saves disk space. It keeps each version of a package only once, in one store on your computer. Each project then links to the files in that store. It does not copy them. So ten projects that use the same package share one copy. It installs from the same npm registry as npm and Yarn.

Example code

console
$ pnpm add react
Adding a package links it from the shared store into the project.
pnpm is one of three JavaScript tools. It shares one copy of each package.

Common mistake

Expecting a package to be found when you never added it. pnpm is strict and only lets code use what it listed.

Key takeaways

  1. 1
    One store. Each version is kept once per computer.
  2. 2
    Links, not copies. Projects point to the shared files.
  3. 3
    Strict. Code only gets what it listed.

Compare

Learn it properly