Ask HN: Why is Node.js hated so much? | Hacker News


Probably the worst thing is that the standard library with Node Javascript is tiny. Therefore, you have to pull in a pile of NPM packages to do pretty much anything. The package ecosystem is rather messy for the same reason - there's a mountain of tiny packages doing a few little things because somebody needed to do just a few things and didn't want to pull in some massive library that does a ton of stuff including the thing they need to do. Which then leads to a lot of bigger and more useful packages having huge dependency trees of tons of little packages, all at poorly-managed versions that usually can't be shared with any other big packages. So a program that needs, say, 3 major packages to do something useful might end up with thousands of dependencies taking up hundreds of megabytes, often with 3+ copies of the same package at different versions.

For example, I have a little webapp that I built with create-react-app with typescript and redux. Very convenient overall admittedly. It's not very big, maybe 1k lines of code total, and 3 fairly minor packages added to do various things. The node_modules folder has over a thousand items in it, and takes up 350MB. The yarn.lock file alone is half a megabyte. Ahem, what the hell? At least the built artifacts are pretty small.

This might be seen as just a problem with create-react-app. But in my experience so far, pretty much everything in the Node world does this. Seriously, has anyone managed to do something useful in the Node world without ending up with a thousand packages?