2 ms·
I think that we are in a situation where the number of dependency doesn't have any meaning anymore for people working on web frontend projects. Recently while r
by dgellow 7y ago
I think that we are in a situation where the number of dependency doesn't have any meaning anymore for people working on web frontend projects. Recently while revamping parts of the CI/CD at $WORK, I found out that running npm install for one of our frontend project downloads around 1 million dependencies. And npm audit reports a completely ridiculous number of security issues with them.
It's just so absurd and nonsensical, nobody can understand what that even mean.
Seems to me to be a crazy huge liability, but quite a lot of people seem to be fine with that.
I don't know what to do from that information, but trying to create some awareness around the issue feels like talking about the number of operations per second a CPU does with someone who has zero idea what a realistic range is. It's seen as a high number, but doesn't have any meaning attached to it.
Edit: I don't have access to the project anymore to check more details (such as installation time), but I checked some personal notes I took when I found this out, the redacted output from npm audit is the following
$ npm audit
<REDACTED> vulnerabilities found - Packages audited: 927016
Severity: <REDACTED> Low | <REDACTED> Moderate
Done in 41.62s.
So slightly below the 1 million mark.
Edit 2: Now I'm wondering ... maybe the "packages audited" from npm audit doesn't mean "you have that number of packages, and I audited them". But if that's the case, that's a terrible UX, and I have zero idea what that number mean, which kind of support my point.
- Ayesh 7y agoA million dependencies sound horribly excessive, even by JS standards.
- dgellow 7y agoThat was my reaction too.
- awinter-py 7y agohow long does that take to install? is there a local npm mirror / cache?
- crazygringo 7y agoI mean npm only has slightly more than 1 million packages, last I checked. This doesn't make even the slightest bit of sense. Did somebody somehow just import... everything by accident? Did npm hit a bug? Is there some infinite recursion going on that eventually hits a wall? This obviously isn't representative.
- renke1 7y ago1 million packages most of which have more than a single version.
- jfkebwjsbx 7y agoHow is this even possible? How are there 1 million interesting packages?! In my job we use like, I don't know, 20 libraries total, out of, say, 50 alternatives that could do the job. Including dependencies of the dependencies I don't think we reach anywhere near 100. Every dependency is discussed with the entire team when we add it. How do you even have time to manage 1 million?!
- doubleunplussed 7y agoPresumably almost all of the dependencies are transient dependencies, not direct ones. I still can't fathom getting to a million though.
- BiteCode_dev 7y agoTo quote the article: "Luckily, most of them are using the same version of lodash, which just needs one lodash to install inside node_modules. This is often not the case with real-world production projects. Sometimes, different packages require different versions of other packages." Npm lets you install several versions of the same package. This has the advantage of saving the dev the testing of their lib with a wide range of dependencies versions: it almost always works. Unfortunately, that means most devs just choose one version and call it a day. They build libs like one would build a project: as you were alone in the world.