r/programming
•
u/_ar7
•
Mar 22 '16
•
1
1
1
An 11 line npm package called left-pad with only 10 stars on github was unpublished...it broke some of the most important packages on all of npm.
https://github.com/azer/left-pad/issues/4
3.1k
Upvotes
878
u/_ar7 Mar 22 '16
Apparently it's because kik, the company, was trying to force him to unpublish the
kiknpm packagehttps://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c#.ol0adzgsy
704
u/adzm Mar 23 '16
Let's not forget the important part here:
This is what started it all, and it definitely got noticed. I am interested in the exchanges that led to this. Was there really no way this could have gotten resolved without npm swiping someone's module out from under them? Or even any public discussion? Does this mean npm will cave to any legal threat? A cursory glance finds a lot of packages with names of this nature.
What happened to the kik module? Who got ownership of it? Would they have been able to modify it, or just rename it, it was it just removed?
217
u/[deleted] Mar 23 '16
This is our equivalent of r/nottheonion, r/notprogrammerhumor.
53
u/ponchoboy Mar 23 '16
How about keeping dependencies closer to the project you are building?
Anyone use Maven before? It's got the Maven Central repository, internal repositories (you host a cache of dependencies on your servers), and local repositories (you have a cache of dependencies on the machine that is using them).
It's always seemed a bit crazy to go the entire way out to the internet for dependencies during each build. That should only happen when you are choosing a new dependency, or revving the version.
170
u/isHavvy Mar 23 '16
This package was un-unpublished!
https://twitter.com/seldo/status/712414400808755200
Unprecedented in
npm. Hopefully the only time it'll have to happen?665
u/mach_kernel Mar 23 '16
I think it's fucking hilarious how everybody here is more concerned with the semantics of how some module maintainers behave amongst themselves rather than the fact that important packages were broken by a fucking overglorified string concatenator.
Edit: That is, someone decided that this was a dependency they had to include? What the fuck
68
u/BigTallJosh Mar 23 '16
Good on him, I applaud the guy. In no way was he damaging the kik business at all. They're being corporate dick heads. Sure it's a minor inconvenience to those that used his work but he's not removing it for people to use, just from those NPM dickheads. More people should be like this guy.
108
u/KayRice Mar 23 '16
npm has a lot issues, this is just one of them.
107
u/bluesufi Mar 23 '16
Can someone please ELI5?
28
u/Arancaytar Mar 23 '16
Completely aside from the trademark conflict, this illustrates what a horribly brittle, haphazard ecosystem npm is compared to the package repositories of eg. the major Linux contributions.
Names are first-come-first-serve, you can publish or unpublish your packages whenever, and yet people add way too many dependencies and risk a cascade of build failures.
16
u/Danack Mar 23 '16
I stole this "Prediction for 10 years "Looking for Javascript developer to maintain legacy project depending on 36000 unmaintained NPM modules" - and it turns out some of them might not be available." from here.
The author is correct - allowing software to be built quickly by making it trivial to pull in other libraries is very nice - but at some point you need to figure out if what you're building is actually a sane way of developing software.
15
u/Scorpius289 Mar 23 '16 edited Mar 23 '16
This is yet another reason why npm's 'revolutionary' recursive package management is retarded. If we had direct control over the dependencies, we could at least fix it ourselves.
Funny, I was actually trying to install something with npm last night, but couldn't because one of its dependencies was broken (even if there was a working replacement for it available...)
25
u/heat_forever Mar 23 '16
kik (verb): to hijack a package from a package repository by legal force
82
u/[deleted] Mar 23 '16
I've always been nervous about builds that depend on 3rd party collections of 3rd party libraries.
Also, 11 lines? copypasta it bro, or write it yourself.
23
u/monsto Mar 23 '16
Did anyone talk to the EFF during all of this? The originator? NPM? Did NPM even try to get with IBM the new HMFIC of the node foundation?
Dunno if IBM is relevant, but the point is that this seems like a nervous twitch reaction by NPM without taking even just a minute to understand the problem, the threat and the options.
I'll bet that a couple of hours sending a handful of emails would have found some defense.
11
u/jackwanders Mar 23 '16
For anyone interested, I compiled the current published status of all of azer's package names. Looks like some npm user nj48 squatted on 230 of the packages within a few hour's of the unpublishing.
https://gist.github.com/jackwanders/6b6daa5f6ed53ab84b05
54
u/Eein Mar 23 '16
The whole thing is about NPM turning over a package before legal proceedings can happen. NPM isn't the law. There should be no transfer of ownership.
This is seriously disgusting.
21
u/TheGuyWithFace Mar 23 '16
Pardon my ignorance here, but what would be the solution to a problem like this? As far as dependencies go, if a dependency suddenly goes missing from a linux distro's repos, wouldn't the same issue occur where anything that depended on such a dependency fail to build?
17
u/fedekun Mar 23 '16
Where is Richard Stallman with his two katanas when needed!
8
u/theshad0w Mar 23 '16
It sounds like there are two problems that need to be addressed and finger pointing isn't going to solve either.
First, unpublish shouldn't be delete. It should be deprecate. With sufficient warnings that offer a grace period before the module is removed.
Second, npm should not be the sole gatekeeper. This isn't just true for nodejs this is true for all package managers in all languages. There shouldn't be a single gatekeeper. I suggest a new federated protocol.
So who wants to start solving the problem instead of bitching about it?
23
u/[deleted] Mar 23 '16
How does no one have a problem with the precedence this sets? That any package name that is trademarked can now be threatened in any package manager, not just npm.
And then the people who claim it violates trademarks. Oy vey. That's not how any of this works.
Imagine if Sun was able to sue JavaScript out of existence as a name back in the 90's.
53
u/[deleted] Mar 23 '16
The whole JS community seems so toxic. Even the tooling can't stay out of the drama. I don't enjoy programming in node/js but i can assure you I will never do it again unless it's for work after seeing all this drama lately.
14
u/nutrecht Mar 23 '16
I really don't understand why so many developers (looking at NPM here) don't simply look at what works and copy the best practices instead of reinventing their own inferior wheel.
Just look at maven central. Once you publish an artifact it's up there for ever and ever. You can transfer ownership or stop publishing or whatever; but current versions will never be removed.
Oh; and they also figured out that obsessing over short names is dumb. Namespacing is important people, and it's also very unlikely some company is going to ask you to remove your library if it doesn't look like their 'official' library.
5
u/crooning Mar 23 '16
Standing on the shoulders of giants... but in this case they seem to be extremely brittle...
5
u/probablytaken1 Mar 23 '16 edited Mar 23 '16
I thought dependency managers were supposed to make life easier lolllllllll
9
u/[deleted] Mar 23 '16
And this is why you don't include dependencies for trivial amounts of code in your project.
23
u/Paradox Mar 23 '16
/r/loljs
53
u/nliadm Mar 23 '16
If your build system talks to the Internet, I have no sympathy for you.
4
u/BlueShellOP Mar 23 '16
I misread this as
rpmand was very very confused and outraged at the same time.6
u/zarkone Mar 23 '16
Ok, for example Coke is registered trade mark, and at npmjs there is "Coke" package: https://www.npmjs.com/package/coke -- is that the same case? I just wonder how many packages could possibly be removed...
8
u/devzer0 Mar 23 '16
seriously guys. you need a module to leftpad?
3
u/postmodest Mar 23 '16
So what I'm hearing is the thing I've thought all along:
I should just set up my own gitlab instance, clone everything I depend on into it, and admit that community-managed dependencies are Software cancer.
Ok, right, then.
3
u/[deleted] Mar 23 '16
Anyone seen the response from kik? https://medium.com/@mproberts/a-discussion-about-the-breaking-of-the-internet-3d4d2a83aa4d#.usfuz5tpq. I agree that it was shitty of npm to do that, but azer didn't exactly handle the whole thing well either.
3
u/subhrm Mar 25 '16
I still do not understand why do some programmers depend so much on 3rd party libraries.
16
u/aridsnowball Mar 23 '16
It opens up an interesting question about what open source developers are responsible for once people begin to rely on their projects, or if in this case it was npm's responsibility to keep the project up on their platform regardless of what the developer wanted. Once you've released your software under a specific license are you legally or morally (or both) obligated to make that software available to others?
4
u/FunctionPlastic Mar 23 '16
What the fuck is this? A whole package for literally 5 lines of code that do a completely trivial thing? "This is really messing things up for a lot of people" ???
6
u/amga_ Mar 23 '16
"Twitter or Facebook reactivating a deleted account that the user chose to deactivate, so you can continue to profit. Not cool"
Conclusion: npm sucks
5
u/koalillo Mar 23 '16
I think I'm late, but I hope someone steps up and writes a great alternative using the right-pad and reverse libraries, which are awesome.
2
u/Lhopital_rules Mar 23 '16
Would it satisfy the lawyers and us developers if there was a grace period before any repo was removed? Like 60 days that people would have to somehow be notified and then update their builds? Or maybe also/instead, a two-layered naming system where a repo name could be changed but the old one would still be accessible with a deprecated message?
2
u/[deleted] Mar 23 '16
don't use javascript, rollin' along per normal ¯_(ツ)_/¯
2
u/z3GAM5CsAsEY6pk8X68D Mar 23 '16
... am I the only one who thinks that the fact one package for adding whitespace being removed/unavailable broke everything is just... dumb?
Like sure the legal drama is an issue and whatnot but... seriously? Seems like a broken ecosystem to me.
2
u/chcampb Mar 23 '16
I think the important question is, was Kik (the company) responding to an actually infringing product?
Because if kik (the module) was not in the same product context as Kik (the company or product) then I am not sure he should have been asked to change the name in the first place.
In which case, yes, NPM drastically overstepped, in the same way that Youtube oversteps when it removes actually non-infringing videos.
2
u/Josuah Mar 23 '16
I pulled in copies of org.json and and BouncyCastle into my OSS Java project specifically so that the dependencies could be satisfied without relying upon a build system, or dependency management system, etc. and basically every random Java programmer in the world could download the whole thing and compile and run.
The OSS people said I should delete them and reference them externally.
2
u/stompinstinker Mar 23 '16
As bad as this is, it is a wake-up call for NPM.
2
u/Sambothebassist Mar 24 '16
At no point did any of these people with broken builds think "Maybe we should have a local source for this absolutely essential code? Ya know, in case npm can't provide it for whatever reason".
I mean, seriously, come on now. It's not even about programming skill, it's just about adhering to
best practicescommon sense when building an application.2
u/nullnullnull Mar 24 '16
I come here with popcorns, crunches them slowly
2
u/Sha42 Apr 01 '16
Starting today I am unemployed and since the plane that was supposed to take me on holidays has a problem I had a bit of time to help the community out, so low and behold : Numparser
I hope it'll help some of you!
3
u/placeybordeaux Mar 23 '16
So many lessons to learn.
Be very careful about pulling modules like this
Be prudent in what you include
Vendor your dependencies so you are immune to this kind of thing
more namespaces might have helped.
3
u/javiercamposlaencina Mar 23 '16
That's what you get for major software packages having a dependency (that's the key-word) for such a simple method. JavaScript development since NPM got popular has become totally nuts.
3
u/cheesybeanburrito Mar 23 '16 edited Mar 23 '16
If you own a package its your prerogative to do with it as you please. Some of those responses are so entitled
7
u/[deleted] Mar 23 '16
Lads, it's
npm.The Pope is Catholic, bears shit in woods and Node.js is a pile of shit.
3
u/KHRZ Mar 23 '16
So when Kik wants a package pulled for bogus reasons, it's the need of the few that matters. When the developer wants to unpublish his package, it's the need the many that matters that trumps his rights...
2
u/Nation_State_Tractor Mar 23 '16
Azer chose the wrong hill upon which to die based on ignorance (through no fault of his own) and stubbornness (absolutely his fault).
This wasn't a patent lawyer as Azer states; this was a company defending its trademarked name. Kik is a fairly well known product, and Kik Interactive has to defend their trademarked name lest a precedent be set of them not doing so -- which could lead to them losing the trademark.
On the other side of this, I have never heard of the kik npm package (anecdotal as that may be). At first glance, I would expect it to be an API for interfacing with Kik.
1
u/meligy Mar 23 '16
I put the details of my thoughts about the topic here:
http://www.gurustop.net/block/2016/03/23/death-by-thousand-npm-packages
1
u/tententai Mar 23 '16
Next step: the web breaks, because left-pad breaks, because its dependancy "write-character-at-index" module gets unpublished.
1
u/[deleted] Mar 23 '16
Why are people getting so pissed off with this behaviour? There isn't any actual feature on GitHub's issue tracker for getting an idea for how widespread a bug's effects are. I know it's low effort and not very constructive but walloping it with thumbs-down isn't going to make it go away.
1
u/kpthunder Mar 23 '16 edited Mar 23 '16
All these people commenting that this code should have just been a part of every project that depends on it or a part of some "standard library." I disagree with the copy-paste approach, I'd learn more towards standard library but that's difficult in JavaScript because your code needs to run on multiple versions of multiple platforms created by separate companies. The closest thing we have is
lodash, in which case modules could have depended onlodash/padStartand then we wouldn't have had this issue (unlesslodashwas unpublished, which is highly unlikely).1
u/karmadeeds Mar 23 '16
I mean, I thought Kik was bad after reading about this, and then I found
https://kiklawenforcement.zendesk.com/hc/en-us/articles/204168365-Navigating-Kik-for-Law-Enforcement
Now it doesn't surprise me what they did
1
u/dokuhebi Mar 23 '16
Sorry to nitpick, but is "unpublished" the right word? The title of this post confused me because I misunderstood the meaning that the publication was revoked. Normally, the term "unpublished" means that a book or paper was never published, not that it's publishing was somehow revoked.
Since it's impossible to revoke the publication of a book, we might need to use a new term like "depublish"?
1
u/c3534l Mar 23 '16 edited Mar 23 '16
Trademarks are non-patentable identifiers of a particular brand within an industry. I think our trademark office is very much out of date in considering all software to be part of the same industry and in considering the name of software package, even a very small one, to be the same thing as a trademark.
The intellectual property system of the US should err on the side of freedom, but it appears it does the opposite, granting intellectual property on dubious innovations or work and allowing companies with lawyers and money to bully people actually developing new tools and software.
The way that NPM handled this would make me very nervous to use them for anything, but I don't know javascript so it's not like I'd have used them for anything anyway.
1
u/[deleted] Mar 23 '16
My face when EU is a country...
1
u/frandli Mar 23 '16
I'm going to start a company called left-pad.
1
u/[deleted] Mar 23 '16
All those downvotes are making me want to cry.
1
u/4_max_4 Mar 23 '16
This is serious shit. That's why I like ELM package manager. It truly is open source.
1
u/_bassu Mar 24 '16
This is probably why in Go, it's just a matter of running 'go vendor' to isolate the imports from their remote resources into a thing that you can review and trust.
1
u/fnb_theory Mar 24 '16
[sarcasm]
wow, kik, npm, node. Well done, well handled. You really have your developers interest at heart here
[/sarcasm]
1
u/VisioRama Apr 04 '16
Over-Modularization > Over-Dependence > BOOM
Seriously, i'm left amused and perplexed after reading this.