Blog

Setup

JS

pnpm vs npm vs yarn

pnpm awesome alternative to npm

Ragav Kumar V

Ragav Kumar V

May 17, 2022 โ€” Updated May 21, 2022 ยท 1 min read

npm takes lots of space on the local machine, mine just 15GB space for 100+ React/Node projects and also takes a lot of time to install.

pnpm solves this by installing packages in a central location .pnpm-store instead of the local folder of your project.

  1. Fewer spaces - 500MB node_modules takes only 14MB space
  2. Faster - npm takes about 1.5 minutes to install a package, pnpm takes about 10+ seconds
  3. Easy to migrate - no special setup needed - commands are very similar to yarn

It is effective when the same packages are used in many projects

I have saved space up to 42 times

  1. Using npm itself ๐Ÿ˜ - npm install -g pnpm
  2. Delete node_modules & package-lock.json
  3. pnpm install
  1. npx โžก pnpx
  2. npm install react โžก pnpm add react (just like yarn)
@ragavkumarv
swipe to next โžก๏ธ