5 ms·
I hated NPM... then I started trying to use some Python projects. Now I like NPM.
by simmerup 4y ago
I hated NPM... then I started trying to use some Python projects.
Now I like NPM.
- lucideer 4y agoYes! I feel like so much criticism of NPM comes from either people who've only ever used NPM, or people who haven't used NPM and just saw a big node_modules once. A common one in work is Java devs criticising the huge node_modules folder but not realising that .m2 exists as their IDE handles it for them "by magic".
- simmerup 4y agoTo be fair I prefer Maven, but probably more for the culture. In Node you generally ask for the latest version and hope it’s still available/the project still builds when you come back to it. pom files are more clunky but they do tie you down more
- lucideer 4y agoThis isn't really true though. Npm supports a full selection of semver specifiers, including pinned versions & Maven versions plugin handles ranges allowing using the latest just as npm (pretty sure maven also does this natively). There's no difference in what each manager does here: any community difference is going to be incidental convention. Npm also uses package-lock files which tie your install down strictly, in case that's what you're referring to?
- simmerup 4y agoI mean yeah, you’re right. But in practise npm allows you to wildcard version numbers. And when you come across old npm projects, you’re likely dealing with people that have wildcarded their dependency versions. Sure if you start from scratch you can adopt idioms that work for you, but in general you’re more likely to get into dependency messes with npm than maven from my experience largely because of the wide use of patterns instead of locked down versions being pulled in.
- lucideer 4y agoIf it's an old npm project without a lockfile, then yes, community convention will scupper you there. Lockfiles have fixed that.
- waste_monk 4y agoHow is python package management a problem? spin up a new venv, pip install whatever, away you go. I don't do a lot of python work so maybe I'm not hitting the boundaries, but it's never been anything less than pleasant to work with in my experience. JavaScript can go directly to hell.