DEV Community

Discussion on: Are you a YARNer or a NPMer?

Collapse
 
nikfp profile image
Nik F P • Edited

PNPM all the way, unless for some reason I have to use something else for some reason.

  • Install a dependency another project is already using on the same machine > FAST
  • Clear node_modules and reinstall > VERY fast vs others
  • Raw install in a CI worflow or fresh OS distro > usually faster than Yarn, always faster than NPM in my experience
  • Workspaces just kinda works. I fought with workspaces in NPM and had all manner of issues with they way things were hoisted, dependency versioning issues, and even VS Code not recognizing imports from dependency packages I was writing in the same Monorepo. All gone with PNPM
  • MASSIVE savings in disk space, since each dependency version is stored in a global cache once, and then linked in to each project. This is also why things install faster, if a dependency has been installed on the OS before, nothing gets pulled over the network.

Right now, PNPM is my only globally installed dependency. Everything else can be explicitly listed in each project without having to be reinstalled for each project, which has saved me from some CI headaches I ran into with NPM previously. (Like forgetting to list typescript, and having it work locally because of a global install but NOT work on CI because there are no global installs)

I know I sound like a fanboi, but its my happy place.

Collapse
 
kerrickchan profile image
Kerrick Chan

I heard NextJS has dependence graph problem.🤔 it good and fast but not fully support some old project🥲