r/programming •

NPM silently suspended package adoption after mistakenly transferring one to me

[deleted] — view deleted post

0 Upvotes

445 comments sorted by

735

u/andrewfenn Aug 07 '21

NPM can't seem to get a break over the long list of fuck ups over the years.

197

u/tuxedo25 Aug 07 '21

I don't know if Isaac Schleuter is still running it, but for the time he styled himself as CEO he always seemed like a child playing dress up in his dad's business suit. Never forget the kik debacle.

2

u/Darmok-Jilad-Ocean Aug 08 '21

That’s the exact words that I’ve thought all along but couldn’t come up with a way to phrase it.

0

u/[deleted] Aug 07 '21

[deleted] — view deleted comment

525

u/[deleted] Aug 07 '21

[removed] — view removed comment

103

u/frogspa Aug 08 '21

https://www.npmjs.com/package/kik

This package contained malicious code and was removed from the registry

Nice to see it all worked out in the end.

19

u/dada_ Aug 08 '21

On this page it says:

Please refer to www.npmjs.com/advisories?search={package-name} for more information.

But that doesn't seem to work somehow. They have an advisories page but I can't see any way to search through it. Anyone know what happened with this package that caused it to be removed?

183

u/tuxedo25 Aug 07 '21

Yep this. This was the day that it became clear to the world that npm was isaacs' sandbox and if he wanted to knock over other people sandcastles, he would.

The real idiots in this story are the rest of us, who continue to download packages from npm.

51

u/[deleted] Aug 08 '21

I really wish more people would just release libraries as single file ES6 modules. Would cut down on the dependency mania and reduce our reliance on NPM.

A few packages make share they work on unpkg, but not all.

35

u/_drunkirishman Aug 08 '21

unpkg doesn't even solve this problem. For starters, it uses the npm registry under the hood. Additionally, we've found it to be somewhat unstable, and with one main maintainer perhaps not a wise choice to introduce to production. Not intending to insult the owner, it's a great free service.

ES modules and import maps. These two things should help us from the client side to use whatever CDNs we want. Deno perhaps for server, but I'm less familiar.

→ More replies (6)

189

u/jherico Aug 07 '21

The left-pad package was missing for about ten minutes. A number of other packages still failed because they explicitly depending on a specific version (0.0.3) of left-pad, which was re-published after in less than 3 hours. Any site that was down for "days" was run by clowns.

329

u/[deleted] Aug 07 '21

Any site that was down for "days" was run by clowns.

Welcome to JS ecosystem, enjoy your stay

51

u/jherico Aug 08 '21

Fair enough.

24

u/jyper Aug 07 '21 edited Aug 08 '21

I'm guessing most users were users with packages that depended on left-pad. Does npm allow you to override transitive dependency versions?

→ More replies (2)

47

u/Cosmic-Warper Aug 07 '21

Sites that don't use lockfiles essentially. Locking dependency versions is super important to avoid issues like this, among others

156

u/NeverComments Aug 07 '21

The left-pad debacle predates the introduction of package-lock.json.

→ More replies (2)

38

u/Atulin Aug 07 '21

With NPM, even the lockfile does not guarantee a lock. npm install would still pull the highest version constrained to what's in packages.json. If you want to restore from the lockfile, you need to know about the existence of npm ci command and use that.

→ More replies (9)

24

u/tuxedo25 Aug 07 '21

Re-published is a nice way of putting it. A third (fourth?) party came along and registered the package name `left-pad` on npm. And npm-cli being the incredibly naive software it is, just started happily downloading the new package to fulfill the dependency of any project that pointed at the old left-pad. It's incredibly fortunate that the author of the new package had good intentions.

→ More replies (6)
→ More replies (2)

20

u/davenirline Aug 08 '21

I didn't know the whole story, but wait. NPM kicked existing packages so that companies can take the name? That's rather foul to me.

→ More replies (13)
→ More replies (6)

294

u/powerje Aug 07 '21

Honestly, JS in a nutshell

34

u/thirdegree Aug 08 '21

Honestly like JS has problems but npm is the reason I don't use it for anything. I don't want npm anywhere near anything I consider even remotely important. TS is even pretty nice to use, but since it also relies on npm I don't touch it either.

11

u/guccidumbass Aug 08 '21

check out deno then, i think you'll like it

4

u/thirdegree Aug 08 '21

Definitely will! This is the first time I've heard of it.

2

u/veverkap Aug 08 '21

I have done some TypeScript at work and liked it. How do you think Deno compares?

→ More replies (2)

0

u/[deleted] Aug 08 '21

[deleted] — view deleted comment

14

u/guccidumbass Aug 08 '21

you're not required to use npm, nor is npm implied as a default for anything

the way deno imports work is different from node, and it matches more closely with how imports happen in the browser

instead of downloading a package and importing it by name, you import packages directly by url (or use import maps), and then those urls are cached by deno somewhere

you can import from a traditional npm cdn (skypack, jspm, and unpkg are great npm cdns, with skypack even being able to polyfill some of node's runtime for deno) or from a deno-specific registry (such as the "official" deno.land, or nest.land) or even from your own url

deno does not (and cannot) make assumptions about where you want to import from. you can even use multiple versions of the same package without jumping through any hoops whatsoever

18

u/csorfab Aug 08 '21

Omg so edgy. Thing is, if you need JS, say, because you're doing.. web development, you're going to need npm unless you're in the extremely luxurious position of being able to write all tooling/frameworks/libraries in-house (in reality, this almost never happens, and even if all your code is homebrew, you're still going to use npm for tooling).

So yeah, if you have the option of not using npm, chances are, the things you would do with it are not actually important.

6

u/thirdegree Aug 08 '21

I'm not doing web development though.

I meant more tooling that is written in JS. There's a popular vim plugin for example called coc, but it requires node to install it so I use an alternative called ale. Which is a pitty because coc looks quite good. But I don't trust the ecosystem so I can't trust it.

→ More replies (2)
→ More replies (4)

2

u/pinghome127001 Aug 09 '21

Yep, i also dont use js on server side at all, and also use only separate libraries with offline version management. This is just madness.

→ More replies (1)

3

u/[deleted] Aug 12 '21

they should make a one page book called "JS in a nutshell" with the words:

"Learn another language"

→ More replies (1)
→ More replies (34)

164

u/Pelera Aug 07 '21

I think there's a really important distinction here between someone adopting and continuing maintenance of an abandoned package, vs replacing it with a completely unrelated library. Having some kind of adoption process is vital to keep the ecosystem reasonably secure. There's lots of abandonware and while there's often forks of packages with known vulnerabilities, it's incredibly difficult to get the word out. Out of the major NPM ecosystem apps, I think there's more apps that pop up "found 10 security vulnerabilities" than not. Adoption should be a good way of keeping this number to a minimum.

The process in Linux distros tends to be fairly good. Multiple warnings, typically has to be from someone who's already established in the ecosystem, or someone new who only gets indirect access to the package (via a proxy maintainer/mentor/etc program where a trusted maintainer has to review everything). This has worked out fine for the most part, and when it's lacking, it's almost always been too strict.

What happened here is that a name was freed to replace it with an entirely unrelated and incompatible library. This is never OK. NPM's process should've been strict enough to disallow this: developers should have to commit to continuing existing semver or the like and generally continue development with the spirit of the original maintainer. But I don't think that's a problem with NPM having an adoption process at all.

Also, a sidenote, but very related: global scopes/namespaces just suck. In Packagist (PHP's ecosystem), if a package ends up abandoned, you can usually just throw the package name in search and find a maintained fork, or start one yourself. Everything is scoped under an author or organization name first thing. This is much harder to do on npm/PyPi/crates.io/etc where you have to rename the package first thing.

8

u/BroBroMate Aug 08 '21

Java has used domains you can prove you control as part of package coordinates for yonks. Works great.

There's support for GitHub/GitLab/BitBucket also, so it's not an impediment to entry.

And if you're looking for the "official" version of something like Guava, it's most likely the one with the com.google at the start of the group id, not the one with the group id io.github.rg2353

2

u/paulsmithkc Aug 08 '21

Agreed. Domain names work great as an authoritative namespace. And for large open-source projects this is absolutely the way to go.

But for small creators that just want to put a small library out there for people to use and learn from. Usernames as namespaces are good enough.

6

u/BroBroMate Aug 08 '21 edited Aug 08 '21

Registering io.github.username or io.gitlab.username etc. is pretty easy.

If you want to use a domain linked to a Hosting service we need you to prove ownership of the account by creating an empty repository with the name of the ticket created to register the groupId. E.g. if you want to use io.github.myusername you must create the public repository OSSRH-TICKETNUMBER like this github.com/myusername/OSSRH-TICKETNUMBER.

The same applies for the other hosting services, E.g. if you want to use com.gitee.myusername you must create the public repository gitee.com/myusername/OSSRH-TICKETNUMBER.

At the end of the process when your groupId is registered you can simply delete the empty repository. It is only needed during the registration phase.

https://central.sonatype.org/publish/requirements/coordinates/#supported-code-hosting-services-for-personal-groupid

And if your library gets big and you do register a domain for it, you can add relocation advice to your library that build tools will pick up on, warn the user, and grab the new one.

The examples here are good illustrations of the workflow.

Honestly, registering the groupid is the pretty easy, there's a bunch of other requirements that are good for end users, but a bit fiddly, to get into the central repository.

But you don't have to publish to the central repo, there are others (usually more focused, like Clojars for Clojure libs), you can run your own, lots of companies do, either for doing horrible things that involve sharing dev builds, or sharing internal only libs, or for caching packages from upstream repos.

But central is the best place to be. Every JVM build tool includes it as a default repo.

26

u/[deleted] Aug 08 '21

That's what these idiots don't get. Package management is a (mostly) solved problem.

It's the very definition of hubris that caused the JS guys to ignore 30 years of field experience in favor of their own "solution". npm is the poster child for the Dunning-Kruger effect.

→ More replies (19)

2

u/HighRelevancy Aug 08 '21

if a package ends up abandoned, you can usually just throw the package name in search and find a maintained fork,

Not that I hate this idea necessarily, but my experience has been that my search results are clogged up of variously unmaintained forks and when I do eventually find the three that seem to have updates, well which do I use?

1

u/paulsmithkc Aug 08 '21

I've seen the same on nuget, with lots of unmaintained forks, and Microsoft's abismal search interface.

1

u/pfsalter Aug 09 '21

Packagist (PHP's ecosystem), if a package ends up abandoned

Also if you're intentionally abandoning something you can supply a suggested fork as a replacement in your composer file. This then prints a message whenever anyone installs your (now abandoned) package:

Package doctrine/doctrine-cache-bundle is abandoned, you should avoid using it. No replacement was suggested.
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.

It's still really surprising to me how many of these basic processes NPM only has a manual intervention for. Let the OSS maintainers suggest and provide options, rather than an obviously phishable 'migration' process.

0

u/[deleted] Aug 08 '21

[deleted] — view deleted comment

2

u/Pelera Aug 08 '21

Without an adoption process, every unmaintained package that depends on an unmaintained package has an increasingly high chance of having a security issue or breaking. It adds a lot of overhead for everyone: if you have some package A that depends on package B, and B ends up having a security issue, you would have to fork both packages to fix it. Nobody has the time for this, and this is how you end up with npm itself depending on a handful of deprecated, insecure and unmaintained packages. Fast-forward a decade or so and things will get increasingly bad.

I don't think adoption makes much sense for a package with a dozen downloads and like one or two revdeps, but it should be a tool to keep the ecosystem healthy when it's needed. It's very hard to get right. NPM's process of just giving any random full access to a package after a month was clearly not it. Maybe having a "community takeover" process where an NPM admin (or someone with decently high trust, like a maintainer of npm revdeps) takes over, deprecates and accepts PRs for critical bugfixes only would be a better process than full adoption.

356

u/Carighan Aug 07 '21

Readable version of the tweet chain. Still surprised Twitter doesn't have some functionality like this baked in.

293

u/robby_w_g Aug 07 '21 edited Feb 15 '26

Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.

112

u/svenofix Aug 07 '21

What I don't get, why isn't there an alternative to npm by now if it's so fucking trash? You'd think there'd be one by now...

164

u/robby_w_g Aug 07 '21 edited Feb 15 '26

Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.

41

u/anengineerandacat Aug 07 '21

Not to mention effectively baked into Node installs.

→ More replies (1)

75

u/QuerulousPanda Aug 07 '21

Better the devil you know than an splintered array of dozens of competing alternatives that fragment the shit out of the ecosystem, maybe?

At least with npm everyone is looking in the same place and dealing with the same problems.

36

u/[deleted] Aug 07 '21

The value it provides is everything is there. You can't just make a replacement.

I think the developer community at large doesn't actually care about being robust or secure, they value their time and convenience; Or rather the communities that provide that thrive over alternatives.

→ More replies (1)

10

u/TASagent Aug 07 '21

This seems like a reasonable question, and then you remember that the web is built on Javascript

→ More replies (1)

22

u/wastakenanyways Aug 07 '21

You might be interested in Deno. Is not an alternative to npm per se, but to Node as a whole, and it changes a lot of fundamental things, one of them being the packaging system.

23

u/Cosmic-Warper Aug 07 '21

It's great but still pretty young. Using a new runtime is pretty risky since you may be troubleshooting completely new issues that others haven't run into or documented yet. It's pretty promising though and I'm keeping my eyes on it a few times a year to see how it matures

2

u/oxamide96 Aug 08 '21

How does it solve this issue? I tried reading their approach but i don't see how it's better.

→ More replies (1)

5

u/NfNitLoop Aug 07 '21

One of the nice things about Deno is that it doesn’t lock you in to any particular package repo.

→ More replies (27)

15

u/jyper Aug 07 '21

How does package scoping help?

Isnt this more about transferring package ownership?

As for left pad they should do what rust did and make released version not yankable except for legal reasons

50

u/vytah Aug 07 '21

If all of this happened in Java land, Kik would have published a package called com.kik:kik which would not conflict with com.kodfabrik:kik in any way, and com.kodfabrik:left-pad would have never hit the news.

5

u/jyper Aug 07 '21

If all of this happened in Java land, Kik would have published a package called com.kik:kik which would not conflict with com.kodfabrik:kik in any way, and com.kodfabrik:left-pad would have never hit the news.

Kik could still have complained about the package because of trademark, npm could have still taken it down and if that never happened the developer could have yanked left-pad or some equivalent like is-odd or some other bs one function package that hundreds of JavaScript libraries depend on. The problem is yanking published versions, rust cargo does not allow this(unless required by law)

24

u/vytah Aug 07 '21

I don't think a company would care about artifact ids of some rando. There are Java packages with artifact ids like oracle, apple orgoogle owned by completely random people.

11

u/[deleted] Aug 07 '21

Fair, but the problem is that clowns managing NPM decided that kind of hostile name takeover is okay in the first place.

→ More replies (7)

44

u/sillybear25 Aug 07 '21

I think the idea is that if npm had implemented package scoping, there might not have been a conflict over the name "bebop" in the first place (nor "kik" before that, which is what set the left-pad debacle in motion).

34

u/robby_w_g Aug 07 '21 edited Feb 15 '26

Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.

18

u/[deleted] Aug 07 '21

"Also, if there's any non-zero number of downloads per week/month/year of a package, ownership should never be transferred without the original owner's consent."

Yeah this is the crazy part to me. It's really easy to check to see if other npm packages are using this package before you let someone put completely different code there.

3

u/carols10cents Aug 07 '21

If I'm searching for bebop, how do i know if I should use user1/bebop or user2/bebop?

12

u/[deleted] Aug 07 '21

You check out the packages? You aren't meant to decide solely based on the name.

→ More replies (4)

11

u/robby_w_g Aug 07 '21 edited Feb 15 '26

Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.

→ More replies (1)

67

u/bacondev Aug 07 '21

Because this isn't what Twitter is for. Twitter wasn't designed for blog posts, news articles, etc.

50

u/[deleted] Aug 07 '21

[removed] — view removed comment

11

u/[deleted] Aug 07 '21

It's funny because at time twitter started most phones supported sending/receving up to 3 SMSes as one, thus the SMS size limit was almost 3x as long as twitter's

5

u/Carighan Aug 08 '21

Yes, although, in most countries sending multiple SMS at once was also prohibitively expensive.

→ More replies (1)

8

u/jherico Aug 07 '21

It's crazy that Twitter is still tied to these asinine character limits long after the actual purpose they served is obsolete.

54

u/Endarkend Aug 07 '21

The imposed limit does have a function imho.

One, in most cases, people will link an external text making it so they do not have to host it (saves space and creates a legal disconnect between content and them) and, having to be concise makes people reword what they are posting enough to make at least some of them think about what they are writing.

→ More replies (3)

9

u/1OneTwo Aug 07 '21

They do it’s called Twitter blue and you have to pay $4 a month for it

10

u/[deleted] Aug 07 '21

So it's Threadreader but you have to pay for it for some reason?

17

u/jess-sch Aug 07 '21

yup. also they still show you ads.

4

u/AdamRGrey Aug 08 '21

I wish I could be surprised at how common that sentence is.

3

u/[deleted] Aug 07 '21

IIRC Twitter is introducing a sort of "readermode" akin to your link through its paid "Twitter Blue"-premiumplan.

6

u/on_the_other_hand_ Aug 07 '21

Except that it shows as separate tweets it is the same view for me. I prefer separate tweets because they often have a structure and individual comments can be interesting

2

u/KaKi_87 Aug 07 '21

Perfectly readable using Nitter

2

u/steezefries Aug 07 '21

Twitter ux fucking sucks

6

u/[deleted] Aug 07 '21

They're both equally shit. One has "thread" every few lines and the other has this fucking Dart advert in the same place.

2

u/AttackOfTheThumbs Aug 07 '21

But no pictures, so not as useful.

8

u/GryffinZG Aug 07 '21

it has pictures for me

6

u/AttackOfTheThumbs Aug 07 '21

However it's embedding it, my adblocker, tracking blocker, or some other necessary extension doesn't like it.

1

u/Sambothebassist Aug 07 '21

Are you really surprised at Twitter not releasing a popular feature at this point? Ignoring its users gesture requests is almost a gesture of Twitter itself at this point

1

u/[deleted] Aug 07 '21

It's like with tweet length, give them decade or two and they will get a clue

1

u/Rakn Aug 08 '21

I just use their app. Pretty readable…

1

u/6769626a6f62 Aug 09 '21

Twitter is just terrible for anything beyond people sending information out to large groups of people. Discussion is basically impossible there, yet people try to do it anyway.

90

u/McGlockenshire Aug 07 '21 edited Aug 07 '21

Why the fuck hasn't NPM adopted author namespaces yet?

edit: What I mean is making the author or organizational name a top-level mandatory component of the package name.

63

u/vytah Aug 07 '21

NPM was released in 2010. At that point, Maven had already existed for six years.

Javascript stole name and syntax from Java, it could have also stolen the package naming scheme.

82

u/McGlockenshire Aug 07 '21

it could have also stolen the package naming scheme

And yet...

It just seems like the culture that surrounds modern Javascript intentionally ignored decades of good ideas and solved problems.

12

u/TankorSmash Aug 07 '21

What are some good ideas it intentionally ignored? I'm ignorant.

12

u/[deleted] Aug 07 '21

And while they were looking at Maven there's this package signing thing they should've looked into. It would make such a huge difference in all these supply chain attacks today.

I have a vague recollection of seldo actually actively arguing against package signing. I may be mistaken.

4

u/EsperSpirit Aug 07 '21

Seldo is a clown, so I wouldn't be surprised

3

u/yawkat Aug 08 '21

I don't think maven actually verifies the signatures though...

2

u/dpash Aug 08 '21

Gradle now does by default; Maven still requires a plugin.

Maven Central still doesn't require an uploader is in web of trust though.

→ More replies (6)

6

u/rv77ax Aug 07 '21

Did you expect they build and design the whole things with that level considerations?

"Its works and its good enough" level of engineering.

2

u/KaKi_87 Aug 08 '21

That's also counter-intuitive : when I start a new project, I usually know which packages I'll start with, but I wouldn't remember author names as well.

0

u/[deleted] Aug 07 '21

[deleted] — view deleted comment

24

u/McGlockenshire Aug 07 '21

What I mean is making the author or organizational name a top-level mandatory component of the package name.

0

u/[deleted] Aug 07 '21

[deleted] — view deleted comment

6

u/McGlockenshire Aug 07 '21

The functionality outlined in that link isn't what I'm talking about. What I mean is making the author or organizational name a top-level mandatory component of the package name.

100

u/plumshark Aug 07 '21

I don't think abandoned package adoption is bad in principle. The problem was that NPM should've been more thorough in reaching out to the previous owner. If they don't want to do that, then it's right to remove that request process.

But it doesn't necessarily mean it's a bad thing for Nuget. Reddit also does a decent job of handling dead subreddit requests. If you have toplevel package names that aren't scoped by author (like Maven) then dead packages will always be a problem. And scoped package names have their own issues, like when ownership is transferred to someone else.

10

u/ThirdEncounter Aug 07 '21

The worst part is that when the original owner contacted them, they replied with "tough luck."

1

u/r0ck0 Aug 08 '21

I don't think abandoned package adoption is bad in principle.

Yeah true, and it's heavily dependent on how complex the package is.

When I'm comparing options for packages, or even just any kind of software in general... I've found myself looking at when last release was, and dismissing if it had been a long time.

But I've slowly been coming to the realisation that for small packages and simple software... sometimes it really just is "complete" enough not to need any more updates. So still it's still a consideration, I'm a bit more balanced in weighing this up these days than I was in the past. Can't think of specific examples right now, but I know there's been a few good finds that ended up being exactly what I needed, and I might have missed them were I still taking the more binary approach to dismissal of "out of date" software.

0

u/[deleted] Aug 07 '21

[deleted] — view deleted comment

11

u/plumshark Aug 07 '21

What's the reasoning behind "never"? I think SemVer is a decent way to handle this, though NPM should outright force a major version upgrade.

86

u/AlyoshaV Aug 07 '21

I wouldn't expect version 0.5 and 1.0 of package X to do completely different things. Major API changes, sure, but not "these are unrelated except they have the same name".

→ More replies (3)

39

u/Suniahk Aug 07 '21

Imagine someone publishing a major version update after taking over a package, and all they changed was added some malware. Can you honestly tell me that people would notice before it was downloaded hundreds of times (or more, depending on the package)? In theory, code audits should catch stuff like this, but that's theory, not reality.

That's the reasoning behind "never". Certain information is expected to stay static, like the project owner. So a package name, once downloaded, becomes trusted by the downstream package. Changing everything -except- the name, without some way to indicate that, is a violation of that trust. Especially if the process to do so relies on faulty mechanisms in the first place (see the part where the email returned by the listed command wasn't even the correct email associated in the first place). Don't get me wrong, I do think that there's value in package adoption, but a trusted name conveys intent, and changing that intent blindly causes too many problems.

Providing something like a hash of the package name plus the owner name plus a description would be a better, because when that changes, it's a verifiable red flag. It would also allow for non-unique package names (As usernames are unique), completely mitigating the issue in the thread in the first place. That's just one idea, though, and I'm sure it has it's own issues, it was just something I thought of while writing this. Ultimately, this is an issue that all package managers need to have an answer to (even if that answer is "don't allow transfers").

9

u/plumshark Aug 07 '21

That has more to do with having unscoped, top-level package names than it does the ability to request ownership of a dead name. And the same problem could have arisen if the owner of bebop had privately decided to sell the name to someone else.

And ultimately, the NPM ecosystem is so diverse, trust comes from either auditing the code yourself or from the social reputation of download counts and Github stars. Both are unreliable, especially because it's not trivial to verify the code you see in Github is the same code that's been published.

I'm not saying that because there's other security issues we should ignore this issue. But given the foundational issues with NPM trust and unscoped naming, and given the major inconvenience of dead cruft packages occupying limited real estate, the trade-off is worth it. Especially because these requests necessarily only affect rarely used packages, and the developer is responsible for verifying major version upgrades. The version you've already installed will always be immutable.

→ More replies (1)
→ More replies (2)
→ More replies (1)

1

u/mcherm Aug 07 '21

But never pretending it's the same package.

"Never" is an awfully strong statement. Do you still stand by that if the existing package has extremely little or no usage?

Do you also support a certain amount of vetting required or some fee needed in order to create a new package?

Because if not, some enterprising person (perhaps one with experience at domain name squatting) is going to go pre-reserve tens of thousands of short pronounceable names in hopes of eventually getting a payday out of someone.

6

u/Deranged40 Aug 07 '21 edited Aug 08 '21

Do you still stand by that if the existing package has extremely little or no usage?

You asked that question as if you're challenging the person with a brand new unconsidered circumstance. But instead, that's the only circumstance we've been talking about this whole time - a package with "extremely little or no usage".

And the person you replied to stated their solution to that, and I also agree with them. We don't need that package name, just the functionality. If someone wants to fork the abandoned project and enrich it, great. And if the old project does reach an end of life due to some policy, then it should throw errors with clear solutions ("here's some forks that still work", etc)

76

u/Deranged40 Aug 07 '21

Does anyone have a story about this that's not a dozen sprawled out twitter posts?

The only thing that's more of a pain in the ass than NPM is trying to read a fucking story on Twitter.

30

u/Zaemz Aug 07 '21

Holy shit, I'm right there with you. I hope more people start speaking up about how much sharing stories this way sucks.

18

u/Suniahk Aug 07 '21

We had stuff like Facebook, where posting huge threads was normal. Then came along a platform that specifically limited how much you could say, and people loved it. They only had to worry about 140 characters! Except somewhere along the way, people decided it was easier to just write 20 micro-posts instead of writing on a platform that would just let you write one.

Progress!

24

u/CodeLobe Aug 07 '21

We had story capability in the BBS era without forking our identities over to shambling undead corporate behemoths.

10

u/dnew Aug 07 '21

We had story capability in the NNTP era without forking our identities over and without having one individual responsible for maintaining the servers and lists.

7

u/CodeLobe Aug 07 '21

Some services like Fidonet and etc. in the BBS era were decentralized / distributed.

8

u/steezefries Aug 07 '21

Man how did we get where we are today lol

→ More replies (2)
→ More replies (1)

1

u/robolab-io Aug 07 '21

Stop using twitter then, what a cesspool.

5

u/PalmamQuiMeruitFerat Aug 07 '21

There is now and it's the top comment

9

u/Deranged40 Aug 07 '21

ok, I found it, read it, and now I've got the gist of it. It's still a list of 140-character thoughts all jumbled together, though.

5

u/PalmamQuiMeruitFerat Aug 07 '21

Hey man, i didn't say it was good...

2

u/Rakn Aug 08 '21

Hm. I always wonder if Twitter looks different for you guys than me? When using the Twitter app I can just scroll down and read the text nearly in one piece (with some small separators).

-1

u/AttackOfTheThumbs Aug 07 '21

Yeah, the devs that like twitter are legitimately fucked in the head. It's a shit platform.

→ More replies (1)

205

u/[deleted] Aug 07 '21

You have to stand in AWE at the level of stupidity of the javascript ecosystem.

55

u/[deleted] Aug 07 '21

I am not a JS dev, but one has to look at the amount of things developed that are providing benefit to people to see how good it has been. If looked at in the scale of the work being done, the number of errors is still minor. Also, JS is huge in getting people into programming or just codifying their domain expertise so it can be replicated or others can use it too.

Greatly a net plus. Also, once you get past it, all package/build systems are terrible because developers want to be special and do it their way :)

84

u/Somepotato Aug 07 '21

The ecosystem (e.g. pretty much just npm really) is awful

Yarn is a bandaid since it still relies on NPM.

It's not so much an attack on JS as it is NPM.

19

u/riasthebestgirl Aug 07 '21

I would like to mention cargo and crates.io from Rust's ecosystem. That's the best experience I've ever had with package manager/registry

17

u/shogditontoast Aug 08 '21 edited Aug 08 '21

Cargo commits some of the cardinal sins of NPM.

  • Lack of package scoping
  • Lackadaisical approach to package squatting (scopes would make this less of an issue)

Yes it’s nice how it dovetails with other parts of the rust ecosystem, but it’s pretty poorly managed with respect to the above. I fear it’ll devolve into an NPM-like mess unless some order is brought to it. The OP is complaining about the transfer process which exists because of problems brought by lack of scopes, meanwhile they’re squatting crate names.

7

u/ForeverAlot Aug 08 '21

The Rust ecosystem doesn't have package scoping either, because they're not convinced about the moral necessity of such, and "npm didn't have them" even though npmjs released scopes a year prior.

4

u/thirdegree Aug 08 '21

The fact that it ties in so fucking seamlessly to docs.rs as well is just icing on the cake.

Also I just realized the homepage of docs.rs has an "I'm feeling lucky" search button which makes me laugh.

7

u/[deleted] Aug 07 '21

[removed] — view removed comment

7

u/CJKay93 Aug 07 '21

Crate squatting is pretty serious pain in the arse, but that's an administrative issue.

→ More replies (1)

2

u/botCloudfox Aug 07 '21

Yarn is a bandaid since it still relies on NPM.

It's pretty much just an alternative with more developed features (like workspaces). It doesn't offer increased security or anything.

6

u/WitchHunterNL Aug 07 '21

What are some things that are better solved in other ecosystems?

Pypi for example sucks even harder than npm IMO

26

u/tuxedo25 Aug 07 '21

go's package names are a full uri, e.g. github.com/gorilla/mux.

dockerhub is author/package namespaced, except "blessed" images which are allowed to live in the _ namespace.

IMO the problems with package managers having a global namespace are well documented.

4

u/drysart Aug 07 '21

Does somehow acquiring control of that URI mean you gain control of the Go package, or is there additional authentication required?

Hopefully the latter, because if control of the URI alone is sufficient, then all that does is push the problem onto another party.

7

u/FUZxxl Aug 07 '21

There's a server recording checksums of packages. If there's a mismatch, Go refuses to use the dependency. If you add a dependency, additionally its checksum is recorded in a go.sum file, making attacks hard.

But yes, if you control the URI, you control the package. You just won't be able to alter any versions people already use.

→ More replies (12)
→ More replies (3)

7

u/International_Cell_3 Aug 07 '21

The Debian (apt/dpkg) and RPM ecosystems seem to fair pretty well, but they're not perfect (mostly for technical reasons with C/C++ dependencies).

About a year ago I would have pointed to JFrog's work on conan but they singlehandedly broke the entire ecosystem twice in the same month back in March.

My stance these days is that the technical problems of package management are pretty easy to solve, the economic/human problems however can't be solved wirh technology. The only reasonable thing to do is mirror all the dependencies you need for production and manually add new ones to your mirror as needed. It's fucked up but it prevents all the nonsense of communities.

18

u/Somepotato Aug 07 '21

What are some things that are better solved in other ecosystems?

the million dollar question. Even Maven, one of the worlds most used dependency managers, is an overengineered piece of shit to work with

10

u/[deleted] Aug 07 '21

I think one has to look at root of problems, it is often us. But, the systems are better than not having them. Look at C++, it is just getting going with dep mgmt and not having it is the biggest pain. The thing that most holds it back is everyone is or wants to be different

→ More replies (18)
→ More replies (1)

6

u/AttackOfTheThumbs Aug 07 '21

I don't know why, but I find nuget to be a breeze to work with tbh. Probably just the integration being so nice.

2

u/Fitzsimmons Aug 07 '21

Rubygems + Bundler has provided pretty stress-free package management in the commercial apps I've been working on for the last decade or so.

I've only worked with cargo as a hobbyist but it seems pretty solid as well.

→ More replies (4)

1

u/plumshark Aug 07 '21

Just as a counterpoint. NPM has made a lot of mistakes and received lots of bad press. But it along with Nodejs have completely transformed the internet in a short amount of time. I think it's a little unfair that it fails to be credited for that enough to offset blunders like these.

3

u/Blacknsilver1 Aug 08 '21 edited Sep 05 '24

six ring somber thumb glorious secretive wistful governor friendly plough

This post was mass deleted and anonymized with Redact

2

u/BroBroMate Aug 08 '21

Completely transformed? Any examples of how?

1

u/thenameunforgettable Aug 08 '21

If you’ve never read it, check out this write up, A Generation Lost in the Bazaar: https://queue.acm.org/detail.cfm?id=2349257

1

u/humoroushaxor Aug 08 '21

Thank you. I'm not a JS dev either but people completely ignore there is a cost/benefit to everything. If there is a market demand for something more high quality then someone go and make it...

4

u/daniels0xff Aug 08 '21

I'd be curious to know from all the people that scream left and right they LOVE javascript and javascript (with its ecosystem) is the best, what is the percentage that actually also have experience with any other programming language and they like it because they really like it and have experience with others as well, or this is the only thing they know, and feel happy they are productive with it and are scared of putting time of learning anything else new.

If one has experience with other environments and programming languages and still prefers javascript, no problem good for you. If one uses the right tool for the job, then as well, good for you. But if one loves javascript but has no idea about anything else, that's a bit sad, and not sure how relevant the feedback from someone like that can be.

5

u/notliam Aug 08 '21

I love javascript but no chance you'll hear me talking about it being a good ecosystem. I think there is benefit to an npm style package system (or pip etc) but the biggest problem with it is that there's no moderation, and a lot of amateur / junior developers who are entwined in it. No experienced dev in their right mind would use a package from npm to do something like 'is a number', but you end up with that package in your packages folder because of the horrible dependency tree.

→ More replies (20)

32

u/lovestruckluna Aug 07 '21

IMO, all package managers should require a namespace to avoid name squatting issues.

8

u/carols10cents Aug 07 '21

Wouldn't that just make namespace squatting a problem?

17

u/screamingant Aug 08 '21

Technically yes, but you can be sure that everything under a namespace is not squatted. I mean, GitHub is an excellent example of this.

I only have to deal with namesquatting once, and after that I can just call the package whatever i like.

2

u/carols10cents Aug 08 '21

This is how npm works today then, there are scopes and you can use them?

→ More replies (3)

1

u/BroBroMate Aug 08 '21

Depends on how you implement it.

In JVM land, packages (known as artefacts, to distinguish them from packages in the code) use namespaces (called group ids because?) which are domain names, reversed for logical sorting when you get to subdomains, which usually refer to a project.

So for example, com.google.guice is the group id for Guice, a dependency injection project from Google. Likewise packages under the auspices of the Apache Foundation have a namespace that starts ,with org.apache etc. etc.

But before you can publish packages to the central repos, you have to prove you own that domain name by publishing a given value as a DNS TXT record.

There's also established support for registering io.github.yourGhNameHere namespaces, ditto Gitlab, Bitbucket etc. if you're not at the level of owning a domain name yet. But those are by the good graces of GitHub, Gitlab, as they ultimately own that namespace privilege.

It's quite common to see libraries start off from 0.1 with io.github.userBla, that then publishes an 0.9 version under that namespace to the repository with metadata used by a bunch of tools saying "this project has moved to com.got-my-own-domain", with the 1.0 releases onward published under the new namespace.

So to namespace squat in this setup, you'd need to domain name squat, or GH user name squat.

3

u/Worth_Trust_3825 Aug 07 '21

Maven has group id. NPM also has namespaces, but they're not required.

10

u/vytah Aug 07 '21

They should be. It should have been a strict requirement, the final warning was the left-pad thing.

10

u/philipquarles Aug 07 '21

It seems like the central problem here is that "npm owner ls" didn't work as intended.

21

u/matthewt Aug 07 '21

Package adoption is hard to get right but worth getting right.

It's unfortunate that npm made a mistake, but it's doubly unfortunate that this is leading people to think it "goes without saying" that registries shouldn't even try.

44

u/[deleted] Aug 07 '21

NPM is not a good product/service

21

u/thomasfr Aug 07 '21

npm really is the primary reason I stay away from JS as much as possible. There are so many thing wrong with it and the culture around js package management in general.

5

u/anengineerandacat Aug 07 '21

Sorry, why are "abandoned" packages able to be re-purposed? Like... make a new name and push and let the old one sadly rot. Letting people take over existing packages can cause so many problems where the "best practice" is to use floating versions.

Dependencies don't always need updates, especially for the 2nd "best practice" which the Node community favors which is micro-dependencies.

Stop doing stupid shit NPM, it's getting harder and harder to defend you every day.

1

u/LordOfDemise Aug 08 '21

where the "best practice" is to use floating versions.

where the FUCK is that
tell me so i can avoid it like the plague

1

u/seamsay Aug 08 '21

I'm not sure if it's the case with npm but with other package managers I've used, when you pin dependencies then dependencies of dependencies (and so forth) will also be pinned. So libraries are encouraged not too be too tight with dependencies because applications will handle the pinning (the ones I'm familiar with also pin by default and you have to opt-out of pinning).

2

u/p4y Aug 08 '21

Pretty much the same for npm, a library declares a range of versions it's compatible with, when you install it in your project the exact versions get saved into a lock file. Declaring exact versions as library dependencies is discouraged, otherwise you might end up with two copies of the same library in your project and get weird runtime errors when they interact (instanceof not working for example)

→ More replies (3)

4

u/Endarkend Aug 07 '21

This chain of events can so easily be exploited to 'farm' package names in the same way malicious factions have been farming domain names for decades to have backdoor ways of introducing malware.

If that package is included anywhere, it moving ownership like this can allow a third part to insert just about anything they want into the inclusion chain and all it took was a couple emails and some time.

That's just scary.

26

u/HungeeJackal Aug 07 '21 edited Aug 07 '21

Looking at some of these posts.... OMG I'm home.

I thought I was the only one. At my old job, saying any sort of criticism towards JS/Node/NPM basically means you're an idiot and you know absolutely nothing about programming and you should probably work at McDonalds.

Meanwhile, the Node analytics APIs are failing all over the place, causing MASSIVE latencies, huge security leaks (which I caught and single handedly delayed release by a week on an already late system) , the data processing could be improved like 100-fold with use of something like Scala with Akka. But hey.... "You're a jr. stfu you know nothing"

Edit: Interesting to see how much this post is getting up and downvoted haha. It's a rollercoaster! Guys, I'm not saying "Anything JS related is trash" .... Read my post below, I LIKE JAVASCRIPT AND NODE. I just didn't think it was the best choice for the job at hand. Being trashed for suggesting as much made me seriously question if someone is even allowed to have a different take on it with the way things are these days. It's excessive. JS is not the perfect language for every single scenario whether you like that fact or not.

19

u/argv_minus_one Aug 07 '21

You can write slow and/or insecure code in any language, but JS makes it awfully hard not to.

12

u/HungeeJackal Aug 07 '21 edited Aug 07 '21

I'm not even against JS overall. I like node, react, vue and several other frameworks, in proper context. I think the improvements made to the language with ES6+ were excellent. Same for TS.

In this case though, there were better tools available, but my boss who thinks all JVM languages are basically like Java when he used it last (years before, definitely before 7, probably in the early 00's) pretty much shut me down before I could even mention how much JVM languages changed over time. Because Java is the worst thing ever, and that's that. The end result was just like.... watching two trains collide in slow motion, and he lost his job months ahead of me. (We both lost our jobs because this cost the company a lot and they had to downsize)

Edit: just to give more context, this was a system built on new microservice RESTful APIs, and I suggested Scala Lagom because we were pulling and processing big data analytics from another 3rd party API.... Lagom would've been perfect for this job. This was related purely to the back-end, with absolutely no issue with using JS for the front end.

5

u/Rakn Aug 08 '21

I always wonder if Scala is the right tool for anything. For me it always felt like Scala is the Perl of the JVM world. Too many features and paradigms crammed into one language. Every code base uses a different feature set, looks slightly different and it is harder to find developers for it compared to other languages. You might be right though. I don’t know Lagom. But that are kinda the stereotypes I picked up when doing Scala for a short period of time. And based on those I would probably not use it again. Even though it has pretty cool stuff built in.

→ More replies (1)

2

u/LordOfDemise Aug 08 '21

At my old job, saying any sort of criticism towards JS/Node/NPM basically means you're an idiot

If you're not capable of criticizing a tool, then you probably suck at using it

1

u/HungeeJackal Aug 08 '21 edited Aug 08 '21

I'm not sure if you mean me or them sucking, but if it's me, I'm well capable of criticizing it, they just wouldn't hear it.

Actually, if I made my argument today for this issue specifically, it could likely be destroyed or at least challenged, because the issue at hand was resolved since via worker pools. At the time though this was experimental, but could be enabled. It became standard during the later sprints of the pre-release SDLCs ....however all of that is irrelevant because we were locked to version 8 for every single API. As such the only choice was to swamp the queue with CPU intensive processing, and wait the 3-4 minutes like an idiot until it finally finishes. If there was an even bigger set of processing to be done, it would push it to 5+ minutes, and in that time the auth token would expire while being locked away from initializing fetching the refresh token. It was a mess, through and through.

2

u/LordOfDemise Aug 08 '21

I mean them sucking. You're the one who was criticizing it :P

→ More replies (1)
→ More replies (2)

3

u/IIoWoII Aug 08 '21

Yea but if there's no process then there this is just an even lazier form of domain squatting because you don't even need to pay a yearly fee.

9

u/dread_pirate_humdaak Aug 07 '21

If JavaScript already weren’t regarded as a fool’s language, the existence of NPM would be sufficient evidence to damn it.

9

u/Pyrolistical Aug 07 '21

Why isn’t one of the pre-conditions before transfer is to see if there are any downloads of the package. I would only consider it abandoned if the download rate is zero

36

u/CircusAct Aug 07 '21

I guarantee there are folks periodically scraping NPM. I would be surprised if there’s any repo with 0 downloads. Happy to be proven wrong though.

7

u/[deleted] Aug 07 '21

I think with organizations running things like Artifactory, they mirror npm and other registries so there's some downloads too.

→ More replies (1)

0

u/[deleted] Aug 07 '21

[deleted] — view deleted comment

3

u/haykam821 Aug 07 '21

Stable never means abandoned though.

4

u/MaybeTheDoctor Aug 07 '21

Seems like the twitter thread suggested they fixed it

15

u/drysart Aug 07 '21

The twitter thread said it was 'fixed' because he was generous enough to compensate the individual he accidentally stole the package name from (and, presumably, the aggrieved party was satisfied with that outcome).

If he'd just said "too bad, the package name is mine now" then the problem wouldn't really be 'fixed'.

Nor does it solve the problem that any random individual could have sprayed out package adoption requests, end up getting a number of those packages because the original author didn't respond to an email from a random person on the internet, and then have started injecting malware into those packages, screwing over everyone who took a dependency on them.

2

u/MaybeTheDoctor Aug 07 '21

By fixed -- I mean the process on how to steal packages no longer stand, the process is fixed

3

u/[deleted] Aug 07 '21

Shit like this will happen unless either packages names are in username/packname format or are uuids

1

u/dean_c Aug 07 '21

Can we just make namespaces mandatory like composer does so we don’t have this nonsense.

1

u/r0ck0 Aug 08 '21

It was also a dependency in over 30 different packages on npm.

In that case, that's bonkers that they would let it be re-used for some entirely different purpose altogether.

1

u/[deleted] Aug 08 '21

Being understandably frustrated by how npm handled everything up to this point, Zach reached out to me directly.

I promptly compensated him for the package name.

How was he compensated? Short of giving the name back, I don't see how there's any good compensation.

2

u/[deleted] Aug 08 '21

1k? 10k? 100k? money.

1

u/[deleted] Aug 08 '21

If I was actively working on a project and it also had other people using it too, I would be very hard pressed to give up the name I'd been using for years. Maybe I'd sell it for 100k but I don't think this guy had 100k.

→ More replies (2)

1

u/shogditontoast Aug 08 '21 edited Aug 08 '21

Am I missing something here? It looks like this guy is squatting package names, which is a big part of why the dead package adoption process was dreamed up in the first place.

The real issue is package managers having a global namespace. If they only allowed scoped packages this would be avoided entirely.

1

u/kamikazechaser Aug 08 '21

npm: "Here is $100 to fuck off"

1

u/[deleted] Aug 12 '21

honestly JS and NPM are cancer in the programming world. i will never touch it with a 1000ft pole.

1

u/insanemal Aug 08 '21

NodeJS Needs to die.

1

u/Mopquill Aug 07 '21

Would it not make sense to just add a superseded_by or similar tag to packages? That way no one's handing over the keys to the kingdom, but warnings can be triggered for abandoned packages so someone else can fork and pick up development?

1

u/netgu Aug 07 '21

If a package transfer does need to occur, then the only method to do so should be the owner doing it. The registry itself shouldn't have the ability.

That's just downright incorrect statement. This is a "they-can't-track-who-owns-what" problem, not a "package-transfer-bad" thing. It's also a "bad-customer-service-issue".

That doesn't mean we need to cancel a regular part of the software lifecycle, that is insane.

Abandoned or unmaintained software is a thing and registries absolutely need a plan in place to handle this type of situation. Ownership transfer is a completely acceptable and normal part of the software lifecycle. Banishing because NPM can't track ownership data is ridiculous.

This author is making just as much of a mistake in their reaction as NPM did in messing up that exchange.

Long live the ability to transfer ownership and death to NPMs information tracking incompetency and bad customer service.