Why I prefer pnpm over npm
Yesterday I had a conversation with Joe Hostyk who pointed out that I hadn't been publishing blog posts in the quick-and-dirty-throwaway manner I had suggested I would be doing. The barrier for publishing had been creeping up again and I didn't publish anything in August at all.
Part of my reluctance to publish is I don't want to start flame wars, but I do want a public record of my preferences so that I can compile them into guidance for my team.
So below are some of my reasons for why I like
pnpm more than
npmhas gotten a lot faster in recent years, but
pnpmstill feels snappier. Speed is a huge factor in the way I pick tools, especially tools that I use very frequently. It's why I tried out
yarnwhen it first came out. Although there are other stronger reasons, speed is one reason I prefer
It makes it easy to run scripts. Even though I still need to get used to typing that first
p, I like
pnpm devmuch more than
npm run dev.
It resolves packages properly. Not sure why
npmhas such a hard time resolving packages. It's not as bad as
pipenv, but still occasionally gets stuck. (This was the other reason I tried
It's hard to import something you didn't install. This is one of the gotchas of
npm: if your dependency has a dependency, you can reference it even though it's not your direct dependency. Depending on something implicitly is asking for trouble.
Eventually, I should compile all these principles somewhere where I track my current set of preferred tools.