npm install: The Civilizational Threat We Agreed To Normalize
Let me set the scene. You want to center a div. You have tried margin: auto.
You have tried text-align: center. You have tried display: flex and then
closed the browser and reopened it. The div remains uncentered. The div wins.
A colleague suggests a package. The package has three dependencies. Each dependency has nineteen.
You run npm install.
What Happened
Your node_modules folder is now larger than the codebase it is supposed to
serve. This is fine. Everyone agrees this is fine.
Among the packages installed: is-odd, is-even, is-number, is-finite,
is-nan, is-null-or-undefined-or-empty-string, and something called
left-pad that will one day hold the entire internet hostage.
Your node_modules folder is now larger than the codebase it is supposed to serve. This is fine. Everyone agrees this is fine.
The Philosophical Problem
At some point, a civilization that sends probes to the edge of the solar system decided that checking if a number is odd required a community-maintained package with eleven contributors and a code of conduct.
// is-odd, 140,000 weekly downloads
module.exports = function isOdd(n) {
return n % 2 !== 0;
};
This is not a critique of the people who maintain these packages. It is a critique of the people who install them. I am one of those people.
The Solution, Apparently
Bun. Or pnpm. Or yarn. Or “just use the platform.” Or “Deno is the future.”
Or “have you considered not needing any of this.”
I have considered it. I still have 847 packages. The div is centered now.
I am not proud. I am productive.
Conclusion
npm install is the digital equivalent of calling a plumber to change a
lightbulb, discovering the plumber also brings forty friends, and then watching
those friends install a new electrical panel, remove a load-bearing wall, and
leave a passive-aggressive note about your water pressure.
But the div is centered. And that is what matters.
The node_modules folder stays. We do not speak of it.