Why pnpm?
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.
Solution
pnpm solves this by installing packages in a central location .pnpm-store instead of the local folder of your project.
Advantages
- Fewer spaces - 500MB
node_modulestakes only 14MB space - Faster -
npmtakes about 1.5 minutes to install a package,pnpmtakes about 10+ seconds - 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
Result
I have saved space up to 42 times
Migration guide
- Using npm itself ๐ -
npm install -g pnpm - Delete
node_modules&package-lock.json pnpm install
Additional tips
npxโกpnpxnpm install reactโกpnpm add react(just like yarn)
References
@ragavkumarv
swipe to next โก๏ธ
