Live data from Hacker News

pnpm: Fast, disk space efficient package manager for JavaScript

pnpm.io

1–10 of 173 posts

Re: pnpm: Fast, disk space efficient package manager for JavaScript

#2
pnpm has been my goto JS monorepo package manager + script runner for a couple of years now. IMO it has almost zero downsides and huge upsides. I'd be surprised if npm doesn't end up adopting the pnpm node_modules directory hierarchy in the next 5 years or so.

Re: pnpm: Fast, disk space efficient package manager for JavaScript

#4

This is my default one, _much_ faster and disk space reduced dramatically when I have lots of node_modules in use. Can't recommend enough.

Were you coming from yarn or npm?

I guess their benchmarks cover both [0]. But I'm also curious about independent figures.

[0] https://pnpm.io/benchmarks

Re: pnpm: Fast, disk space efficient package manager for JavaScript

#5
It works very fast in CI, its cache is smaller and it builds node_modules much faster. I don't feel comfortable caching node_modules folder itself, because I got side effects even causing incidents before, not sure if its supposed to. Speed difference is 15s vs 35s for our use case which is pretty significant.

Re: pnpm: Fast, disk space efficient package manager for JavaScript

#8
post #6

Is there any gotcha if I switch from npm to pnpm? And can I use pnpm when working in a team where other devs use npm?

pnpm uses its own lock file (pnpm-lock.yaml), while npm uses package-lock.json

You definitely should use the same manager (npm, yarn, pnpm, whatever) as your teammates' or you're going to run into problems, either with them or with your CI workflow.

Re: pnpm: Fast, disk space efficient package manager for JavaScript

#9
post #7

pnpm is awesome except when it does not work - which happens very rarely but it is a nightmare to debug. For all the other times, it is way faster and lightweight than npm.

I was unable to use pnpm with a project that used Electron (~2 years ago), IIRC because some spawned process was incompatible with symlinks. It's the only time it caused me trouble though, it's indeed much faster than npm. I'd love to use it at work too.

Re: pnpm: Fast, disk space efficient package manager for JavaScript

#10
post #8
post #6

Is there any gotcha if I switch from npm to pnpm? And can I use pnpm when working in a team where other devs use npm?

pnpm uses its own lock file (pnpm-lock.yaml), while npm uses package-lock.json You definitely should use the same manager (npm, yarn, pnpm, whatever) as your teammates' or you're going to run into problems, either with them or with your CI workflow.

thanks!
Post reply on HN