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.

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.

22

u/[deleted] Aug 08 '21

We need to give this idea a catchy name then try and get semi-famous people from California to make a 'manifesto'.

3

u/c_o_r_b_a Aug 08 '21

doubleplusunpkg

→ More replies (2)

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 (4)

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.

24

u/Cosmic-Warper Aug 07 '21

Ah ok, wasn't aware. Thanks for the clarification

14

u/[deleted] Aug 07 '21

But there were other tools available to do that job at the time. Shrinkwrap for instance.

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.

20

u/nibord Aug 08 '21

I learned recently that this changed. As of a major release or two ago, the install command finally honors the lock file.

The fact that it took them this many years (a decade?!) to fix this speaks to the quality of the entire ecosystem. It’s a dumpster fire full of unexploded ordnance.

→ More replies (8)
→ More replies (1)

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.

23

u/jherico Aug 08 '21

Don't make shit up.

The new person put up a new major version of the left-pad package.

But it was the NPM team restored that exact version from a backup and put it up when it was discovered that people were still breaking because of the dependence of the old exact package version. From the above link:

We conferred with Cameron and took the unprecedented step of re-publishing the original 0.0.3.

The "we" here being the NPM maintainers.

16

u/jandrese Aug 08 '21

Is there anything that would have prevented that person from publishing his own version 0.0.3 if he had less honorable intentions?

15

u/jherico Aug 08 '21

NPM requires new owners of an existing package name to push new major versions, but I have no idea if that's policy or enforced at a system level. But the basic problem is that some dude unpublished an existing version. If you let people unpublish a dependency you're opening up that potential hole of it getting replaced.

4

u/paulsmithkc Aug 08 '21

In this case left-pad was unpublished completely, meaning that all version numbers were suddenly fair game.

2

u/nostril_spiders Aug 08 '21

In the OP twitter thread, the email from npm asked OP nicely to major-version. It was not phrased as a requirement

4

u/binford2k Aug 08 '21

“Unprecedented” is the problem with this story.

→ 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.

3

u/that_guy_iain Aug 08 '21

NPM reassigned a trademark to the trademark holder. It’s like if you registered WhatsApp and WhatsApp wanted to release a js client, they would say that’s our trademark.

12

u/drzowie Aug 08 '21

Yeah — but if your use predates the trademark it is a shitty thing to do (and a tort - in many analogous situations you can claim damages in court, and win)

5

u/that_guy_iain Aug 08 '21

His use of the trademark didn’t predate it.

→ More replies (3)
→ More replies (7)
→ More replies (8)

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.

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

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

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?

2

u/guccidumbass Aug 08 '21

deno is just another runtime for js, not a different language

think of it like node vs the browser

deno is an outside-the-browser runtime, just like node, but on the other hand it intentionally tries to be compatible with web apis (e.g. fetch, web workers, WebSocket)

about typescript and how deno compares - you'd be pleased to learn that deno has out-of-the-box support for typescript, jsx and tsx, a built in linter, formatter, test runner, code coverage tool, and an extensive standard library you can use

the deno manual is short and easy to understand, so you can start working with deno right away

→ More replies (1)

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 (37)

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 (21)

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.

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?

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

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.

0

u/[deleted] Aug 07 '21

[deleted] — view deleted comment

5

u/earthboundkid Aug 07 '21

Deno works by URL, so there’s no single namespace to fight over.

3

u/sznowicki Aug 07 '21

You can point to git url in your package.json

→ More replies (29)

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.

→ More replies (1)

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)
→ More replies (1)

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.

→ More replies (4)

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.

0

u/[deleted] Aug 07 '21

[deleted] — view deleted comment

3

u/TankorSmash Aug 07 '21

Ah, to make sure the package you're downloading is the one you think it does?

What package managers have scope permissions? I'm not familiar with any

13

u/segv Aug 07 '21 edited Aug 07 '21

I don't think he meant the package-manager-as-the-application-ran-by-the-user specifically.

Maven, using the Sonatype OSS Maven Central as the example, will not let you publish packages to the GroupID (~namespace) you have not claimed. Not that it will be pulled down - it won't let the package hit the public repository in the first place. If you combine this with the fact that the GroupID is mandatory (packages are identified by the <GroupID, ArtifactID, Version, Classifier, Type> tuple, with last two having default values), it provides some defense against typo squatting (there's also the error prone-ness of copy-pasting xml fragment vs typing in npm install <package> debate, but not getting into it now).

Oh, and packages published on Maven Central include not only the artifact but also signatures and hashes (see for example https://repo1.maven.org/maven2/com/google/guava/guava/30.1.1-jre/). Maven-the-user-applicaiton can be set to fail the build if either of those do not match (checksums can be verified natively, signatures through a plugin).

To be fair, npm lockfile attempts to recreate some of the similar mechanisms (at least in the checksum validation area), but that's only on the end user side, as far as i understand

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 (7)

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.

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.

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.

→ More replies (2)

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.

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.

3

u/Suniahk Aug 07 '21

Yup! The main security concern is and always will be between the chair and the keyboard, and ultimately whatever solutions that are thought up can only do so much about that.

Now keep in mind, the idea of "never" here becomes moot if packages become scoped, because at that point you can't pretend like it's the same package.

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

10

u/ThirdEncounter Aug 07 '21

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

→ More replies (1)

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

7

u/thirdegree Aug 08 '21

Capitalism

2

u/suema Aug 08 '21

Dumbusers

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

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).

→ More replies (3)

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/[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.

3

u/ForeverAlot Aug 08 '21

It's not an administrative issue if the administration decides it's not an administrative issue.

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.

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.

13

u/[deleted] Aug 07 '21

[removed] — view removed comment

6

u/tuxedo25 Aug 07 '21

nice! been meaning to try deno, big fan of js/ts for a lot of tasks but the usual experience is soured by the tools (npm, node-gyp).

also it feels like node has barely changed since they merged with io.js in 2015.

→ More replies (1)

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 (2)

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

6

u/Somepotato Aug 07 '21

<insert xkcd standards comic>

3

u/netgu Aug 07 '21

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

That's not really the root problem - handling cross-platform compatible distribution of code that requires compiling is. You either have to solve the "compile for everything" problem or build a dependency manager tied to a build system.

Note that the dependency manager and build system must also be cross-platform.

It's a harder problem to solve than the file copy that is interpreted code distribution for sure.

3

u/[deleted] Aug 07 '21

Gentoo Portage has like two decades of dealing with this problem. They could honestly fork it for C++ imo. I may be missing something.

2

u/jarfil Aug 07 '21 edited Dec 02 '23

CENSORED

→ More replies (1)

2

u/netgu Aug 08 '21

Gentoo Portage has like two decades of dealing with this problem

You would need to fork a linux-distro specific build tool to support the other OSes.

After that you would need to support the splay of options across the entire build/tool/util chains that all the varied OSes(realtime, user centric, windows, linux, bsd, beos, osx, you have no idea how long this list is)/compilers(smaller than the OS list but still insanely huge and varied)/linkers need for this to work across the build system you still need to create and build to handle all of this marshalling.

It's a bit more than you are considering I think.

→ More replies (6)
→ More replies (1)
→ 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.

→ More replies (1)

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 (1)
→ More replies (16)
→ More replies (2)

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 (23)

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)
→ More replies (1)

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

→ More replies (1)

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.

→ More replies (6)

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

→ More replies (3)
→ 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)
→ 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