top | item 42254440

(no title)

robertritz | 1 year ago

quickly checks the size of my npm packages

Ok sure. Maybe your dependency tree is clean but I at least have some space on my hard drive.

discuss

order

DemocracyFTW2|1 year ago

The problem you're referring to is real but 1) there exist package managers like pnpm that mitigate the overall size of NodeJS dependencies by using symlinks; 2) the problem is orthogonal to the ease-of-use and relative architectural simplicity that NodeJS dependency management has when compared to Python's.

In hindsight, Python's idea of using one centralized `site-packages` directory for all the dependencies of all your local projects was a big mistake and is what brought us virtual environments, a needless complication of the state of affairs. Npm did the right thing and opted for per-project dependencies. It took them some time to figure out how to de-duplicate and additionally a lot of talking to people to convince them that sometimes, just sometimes folks, you need to have two versions of the same dependent package in you project, but in the end they swallowed it.

This is a far cry from the terrifying complexity that is Python's import statement and Python's wheels and setuptools and the endless configuration files and the wheels and the zipped archives and so on and so on. Having to learn all that feels like doing a bachelor's degree. Very of it is needed, most of it is self-incurred damage, starting from the 100% superfluous `__init__.py` files and the mere existence of `*.pyc` files. Shudder.