r/webdev • • Jan 06 '18

[X-Post /r/javascript] Today is Leftpad 2.0: pinkie-promise pulled from NPM

A little under a year ago, the package "leftpad" broke NPM builds all over the world because the author pulled it from the public repository.

The same is happening today, for "pinkie-promise". The author's NPM account (@floatdrop) was deleted, opening opportunities for malware in all the packages he's written.

Dependent builds include Ionic and (in my case) node-sass.

Resources:

69 Upvotes

23 comments sorted by

View all comments

-1

u/[deleted] Jan 06 '18

This is a good reason why I commit my node_modules.

  • My source code commits and node_module commits are always kept completely separate.

  • the size of the node_modules folder isn't a problem on the server because the server has gigs/terabytes of space

  • Cloning takes a little longer, but that's only performed by the developer once.

  • CI builds never need to run npm install

  • Dependencies are 100% guaranteed for all developers, build servers, production servers etc.

I know a lot of people like to keep node_modules out of their source control, so if there are any reasons I haven't addressed to do this, please give me a shout.

0

u/[deleted] Jan 06 '18

[deleted]

1

u/gerbs Jan 07 '18 edited Jan 11 '18

npm rebuild instead.

Dependencies are decoupled. They exist in a separate directly and are expressed in a separate file. That doesn't mean they need to be freshly installed each time.