pnpm 0,0,0,2,3,0 travis-ci npm

:package::rocket: Fast, disk space efficient npm installs


Status Windows build status Join the chat at

Fast, disk space efficient npm installs

pnpm is:

  1. Fast. A lot faster than npm and yarn. This is not a fair battle as we organize dependencies in a completely different way. Nevertheless, dependencies installed with pnpm are Node.js-compatible!
  2. Efficient. One version of a package is saved only ever once on a disk.
  3. Simple and human-deterministic. Flattening is hard. A package manager can be deterministic but no human can easily predict how will a flattened dependency tree look like. Pnpm not only has a lockfile, the files in its node_modules folder are organized always the same way, the way they are described in package.json files.


Read our contributing guide if you’re looking to contribute.

Follow the pnpm Twitter account for updates.

Table of Contents


pnpm uses hard links and symlinks to save one version of a module only ever once on a disk. When using npm or yarn for example, if you have 100 packages using lodash, you will have 100 copies of lodash on disk. With pnpm, lodash will be saved in a single place on the disk and a hard link will put it into the node_modules where it should be installed.

As a result, you save gigabytes of space on your disk and you have a lot faster installations! If you’d like more details about the unique node_modules structure that pnpm creates and why it works fine with the Node.js ecosystem, read this small article: Why should we use pnpm?


Install it via npm.

npm install -g pnpm

Do you wanna use pnpm on CI servers? See: Continuous Integration.


Use pnpm in place of npm. It overrides pnpm i, pnpm install and some other command, the rest will pass through to npm.

pnpm install lodash

For using the programmatic API, see: API.


pnpm uses npm’s programmatic API to read configs. Hence, you should set configs for pnpm the same way you would for npm.

Furthermore, pnpm uses the same configs that npm uses for doing installations. If you have a private registry and npm is configured to work with it, pnpm should be able to authorize requests as well, with no additional configuration.

However, pnpm has some unique configs as well:


  • Default: ~/.pnpm-store
  • Type: path

The location where all the packages are saved on the disk.


  • Default: ~/.pnpm-registry
  • Type: path

The location of all the downloaded packages and package meta information. Can be also used as a verdaccio storage.


  • Default: false
  • Type: Boolean

If true, pnpm will use only the local registry mirror to get packages. If a package won’t be found locally, the installation will fail.


  • Default: 16
  • Type: Number

Controls the maximum number of HTTP requests that can be done simultaneously.


  • Default: 5
  • Type: Number

Controls the number of child processes run parallelly to build node modules.


  • Default: true
  • Type: Boolean

Dangerous! If false, the store is not locked. It means that several installations using the same store can run simultaneously.

Can be passed in via a CLI option. --no-lock to set it to false. E.g.: pnpm install --no-lock.

If you experience issues similar to the ones described in #594, use this option to disable locking. In the meanwhile, we’ll try to find a solution that will make locking work for everyone.


pnpm is usually 10 times faster than npm and 30% faster than yarn. See this benchmark which compares the three package managers on different types of applications.

time npm i babel-preset-es2015 browserify chalk debug minimist mkdirp
    66.15 real        15.60 user         3.54 sys
time pnpm i babel-preset-es2015 browserify chalk debug minimist mkdirp
    11.04 real         6.85 user         2.85 sys

Prior art


  1. npm-shrinkwrap.json is ignored. Unlike pnpm, npm can install the same [email protected] multiple times and with different sets of dependencies. npm’s shrinkwrap file is designed to reflect the node_modules layout created by npm. pnpm cannot create a similar layout, so it cannot respect npm-shrinkwrap.json.
  2. You can’t publish npm modules with bundleDependencies managed by pnpm.
  3. Binstubs (files in node_modules/.bin) are always shell files not symlinks to JS files. The shell files are created to help pluggable CLI apps in finding their plugins in the unusual node_modules structure.
  4. Node.js doesn’t work with the –preserve-symlinks flag when executed in a project that uses pnpm.

Got an idea for workarounds for these issues? Share them.

Frequently Asked Questions

Why does my node_modules folder use disk space if packages are stored in a global store?

pnpm creates hard links from the global store to project’s node_modules folders. Hard links point to the same place on the disk where the original files are. So, for example, if you have foo in your project as a dependency and it occupies 1MB of space, then it will look like it occupies 1MB of space in the project’s node_modules folder and the same amount of space in the global store. However, that 1MB is the same space on the disk addressed from two different locations. So in total foo occupies 1MB, not 2MB.

For more on this subject: Why do hard links seem to take the same space as the originals?



Related Repositories



:package::rocket: Fast, disk space efficient npm installs ...



:package::rocket: Fast, disk space efficient npm installs ...



Run `yarn install`, `npm install` or `pnpm install` on git hooks automatically ...



Awesome pnpm resources ...



pnpm's shrinkwrap ...

Top Contributors

rstacruz zkochan greenkeeperio-bot davej andreypopp Meesayen PeterDaveHello indexzero iamstarkov kesla rexxars misterbyrne KostyaEsmukov asbjornenge piscisaureus furqanZafar amilajack leipert pra85 ratson rbmrclo vkrol fengmk2


package version
@types/byline ^4.2.31
@types/common-tags ^1.2.5
@types/load-json-file ^2.0.5
@types/node ^8.0.7
@types/nopt ^3.0.29
@types/npm ^2.0.28
@types/ramda ^0.24.1
@types/update-notifier ^1.0.0
byline ^5.0.0
camelcase ^4.1.0
common-tags ^1.4.0
cross-spawn ^5.0.0
graceful-fs ^4.1.11
is-ci ^1.0.10
load-json-file ^2.0.0
loud-rejection ^1.6.0
nopt ^4.0.1
npm ^5.0.2
path-name ^1.0.0
pnpm-default-reporter ^0.8.2
pnpm-file-reporter ^0.0.1
pnpm-list ^1.0.0
pnpm-logger ^0.5.4
ramda ^0.24.1
supi ^0.2.14
update-notifier ^2.1.0
dev @types/mkdirp ^0.5.0
@types/tape ^4.2.30
commitizen ^2.8.6
cz-conventional-changelog ^2.0.0
husky ^0.14.0
in-publish ^2.0.0
npm-scripts-info ^0.3.6
rimraf ^2.5.4
tslint ^5.4.2
typescript ^2.4.1
validate-commit-msg ^2.7.0


-   v0.37.0 zip tar
-   v0.36.0 zip tar
-   v0.35.0 zip tar
-   v0.34.0 zip tar
-   v0.33.0 zip tar
-   v0.32.1 zip tar
-   v0.32.0 zip tar
-   v0.31.2 zip tar
-   v0.31.1 zip tar
-   v0.31.0 zip tar
-   v0.30.0 zip tar
-   v0.29.1 zip tar
-   v0.29.0 zip tar
-   v0.28.0 zip tar
-   v0.27.0 zip tar
-   v0.26.2 zip tar
-   v0.26.1 zip tar
-   v0.26.0 zip tar
-   v0.25.0 zip tar
-   v0.24.0 zip tar
-   v0.23.0 zip tar
-   v0.22.1 zip tar
-   v0.21.0 zip tar
-   v0.20.0 zip tar
-   v0.18.0 zip tar
-   v0.17.0 zip tar
-   v0.16.0 zip tar
-   v0.15.0 zip tar
-   v0.14.0 zip tar
-   v0.13.0 zip tar