News for hackers. Stuff that matters.
Re:Empty NPM package '-' has over 700k downloads by t0mek on Tuesday August 03, 2021 @02:51AM (#28046354)
> Developers should exercise caution when typing npm commands in the terminal when especially when using flags.

The double ”when” is quite funny here, given the nature of npm problem described in the article.

Re:Empty NPM package '-' has over 700k downloads by marechalbernard on Tuesday August 03, 2021 @12:10AM (#28045632)
Re:Empty NPM package '-' has over 700k downloads by tus89 on Tuesday August 03, 2021 @12:15AM (#28045657)
And removing it will probably break half the internet. NPM is a nutshell.
Re:Empty NPM package '-' has over 700k downloads by brundolf on Tuesday August 03, 2021 @12:16AM (#28045662)
It's impossible to unpublish packages now.
Re:Empty NPM package '-' has over 700k downloads by behindsight on Tuesday August 03, 2021 @12:51AM (#28045814)
I agree with the general sentiment, but if you do want to unpublish there is a policy available [0]

Key points being either:

- published within 72 hours and without any dependents

- no dependents, < 300/week downloads, single owner

Of course even with all that said there was also precedent for having it removed if you emailed them directly and it was up to their discretion (I believe this was prior to their acquisition so not sure if that still applies).

0: https://docs.npmjs.com/policies/unpublish

Re:Empty NPM package '-' has over 700k downloads by brundolf on Tuesday August 03, 2021 @01:15AM (#28045908)
Technically. But the above is specifically designed to prevent someone from unpublishing a package that could "break half the internet", which is what the original poster was waxing on about.
Re:Empty NPM package '-' has over 700k downloads by galoisgirl on Tuesday August 03, 2021 @10:05AM (#28049321)
Well, - has 56 dependents, so that ship has sailed.
Re:Empty NPM package '-' has over 700k downloads by baxuz on Tuesday August 03, 2021 @11:25AM (#28050310)
Hopefully an npm alternative will come out, because npm and the entire node_modules & package.json resolution strategy is a joke.
Re:Empty NPM package '-' has over 700k downloads by marto1 on Tuesday August 03, 2021 @01:52AM (#28046070)
Where there's user input there's cybersquatting.
Re:Empty NPM package '-' has over 700k downloads by captn3m0 on Tuesday August 03, 2021 @03:33AM (#28046582)
Having a global namespace for packages was a bad idea. (same with ruby and python).

PHP gets it right: https://packagist.org/explore/

Re:Empty NPM package '-' has over 700k downloads by egberts on Tuesday August 03, 2021 @06:20AM (#28047504)
A simple logic of NOT “-“ would have blocked any reintroduction/upgrade of unintended “-“ package, coupled with a inertiazed package replacing the accidentally-introduced “-“ package.

Yeah, those who depend on the original but accidental “-“ package for its functionally should suffer any consequential breakage that may have resulted from it.

*insert*fake*tear*here*

Re:Empty NPM package '-' has over 700k downloads by throwaway4good on Tuesday August 03, 2021 @02:02AM (#28046126)
So why would anyone make a package like that?
Re:Empty NPM package '-' has over 700k downloads by jeffalyanak on Tuesday August 03, 2021 @03:54AM (#28046707)
In the article they hypothesize that the creation of the package may have been a typo or another form of accident.

Since the content suggests it was generated by a script, there may have been an error in the input to the script or in the script itself.

Re:Empty NPM package '-' has over 700k downloads by tored on Tuesday August 03, 2021 @04:50AM (#28046993)
Maybe, but the project does have an open issue created and edited multiple times by the developer

https://github.com/parzhitsky/-/issues/1

Re:Empty NPM package '-' has over 700k downloads by brettermeier on Tuesday August 03, 2021 @03:17AM (#28046494)
This is normal troll stuff, I would guess. It's like claiming website URLs from known mistypers or something. Someone thinks it's funny.
Re:Empty NPM package '-' has over 700k downloads by throwaway4good on Tuesday August 03, 2021 @02:15AM (#28046192)
And it is version 0.0.1 - how will it look when it reaches version 1.0.0?
Re:Empty NPM package '-' has over 700k downloads by hidden-spyder on Tuesday August 03, 2021 @01:01AM (#28045864)
What even does this package do? I can't understand how to get to the source and the readme is vague.
Re:Empty NPM package '-' has over 700k downloads by imustbeevil on Tuesday August 03, 2021 @01:06AM (#28045881)
Usually I just check the github since most NPM modules link directly to it but the only thing I find find linked is this: https://npm.runkit.com/-/dist/index.js?t=1627966991920

The index file is:

    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.default = null;
The readme mentions that it's a test of this: https://github.com/parzh/create-package-typescript

> Recklessly create TypeScript npm packages left and right with this single command

Re:Empty NPM package '-' has over 700k downloads by tored on Tuesday August 03, 2021 @04:48AM (#28046989)
I think this is the project.

https://github.com/parzhitsky/-

Re:Empty NPM package '-' has over 700k downloads by hidden-spyder on Tuesday August 03, 2021 @10:25AM (#28049573)
Oh my god. Why does this exist?
Re:Empty NPM package '-' has over 700k downloads by James-Livesey on Tuesday August 03, 2021 @07:40AM (#28048045)
> A mysterious, one-letter npm package named "-" sitting on the registry since 2020 has received over 700,000 downloads.

...then a few lines further down the article:

> An npm package called "-" has scored almost 720,000 downloads since its publication on the npm registry, since early 2020.

Kinda frustrating that the same information is being written twice imo... And then two ads in a row follow that

Re:Empty NPM package '-' has over 700k downloads by pajko on Tuesday August 03, 2021 @12:26PM (#28051099)
What would happen if a newer version gets released sometime with some added malware functionality?
Re:Empty NPM package '-' has over 700k downloads by undebuggable on Tuesday August 03, 2021 @04:58AM (#28047034)
Mistyped, incorrect, and copypasted shell commands which are incorrectly using the minus character.
Re:Empty NPM package '-' has over 700k downloads by brundolf on Tuesday August 03, 2021 @12:16AM (#28045660)
Also 56 dependents
Re:Empty NPM package '-' has over 700k downloads by tapout1960 on Wednesday August 04, 2021 @09:46AM (#28060932)
can a newer version be used to introduce malicious code for those downloading or the dependents?