pnpm: Fast, disk space efficient package manager for JavaScript
11–20 of 173 posts
Re: pnpm: Fast, disk space efficient package manager for JavaScript
#12pnpm 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.
https://github.com/npm/rfcs/blob/main/accepted/0042-isolated...
Yarn has a PNPM mode now too:
https://dev.to/arcanis/yarn-31-corepack-esm-pnpm-optional-pa...
Re: pnpm: Fast, disk space efficient package manager for JavaScript
#13Is 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?
Re: pnpm: Fast, disk space efficient package manager for JavaScript
#14Is 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 doesn't auto install peer dependencies, which is annoying and forces you to unnecessary add them to package.json. Npm@7 (and newer) with auto install of peer deps is much easier to use in this regard.
The whole peer dependencies story is another clusterfuck. Everyone simply ignored the invalid peer dependency warnings, and now npm itself will just install all of them in 'whatever works' version. To get real peer dependency resolution you need a --strict-peer-deps flag. Not exactly a "feature" in my book.
Re: pnpm: Fast, disk space efficient package manager for JavaScript
#15Earlier quoted context omitted.
Pnpm doesn't auto install peer dependencies, which is annoying and forces you to unnecessary add them to package.json. Npm@7 (and newer) with auto install of peer deps is much easier to use in this regard.
Isn't that exactly how it's supposed to be? If you're installing a package that has peer dependencies, you should already depend on them. Otherwise they are not "peer dependencies" anymore, just a normal dependency with a version range. The whole peer dependencies story is another clusterfuck. Everyone simply ignored the invalid peer dependency warnings, and now npm itself will just install all of them in 'whatever w…
Peer dependencies added more problems than they solved in my eyes... Most peer dependencies warnings come because some maintainer forgot to update the package.json and not really because two packages don't work with each other...
Re: pnpm: Fast, disk space efficient package manager for JavaScript
#16Earlier quoted context omitted.
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!
(This is not an endorsement of or recommendation of pnpm which I personally don't use daily)
Re: pnpm: Fast, disk space efficient package manager for JavaScript
#17[1]: https://vercel.com/changelog/projects-using-pnpm-can-now-be-...
Re: pnpm: Fast, disk space efficient package manager for JavaScript
#18Does this use symlinks to a single copy of each dependency?
Re: pnpm: Fast, disk space efficient package manager for JavaScript
#19This 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