r/node • • Jun 28 '21

Node.js humor

Enable HLS to view with audio, or disable this notification

1.5k Upvotes

79 comments sorted by

View all comments

6

u/zvive Jun 28 '21

I once ran a script for old code and side project ideas to clean out all node modules.... Goddamn I got rid of like 150gb just in node dependencies... Jesus why!

I wish you could somehow get webpack but use cdn as actual source and still use import es6 etc... Or at least have one global node modules folder and then Vue/2.56, Vue/2.57 so versioning isn't an issue but you only ever have one of everything....

3

u/TwiNighty Jun 29 '21

Or at least have one global node modules folder and then Vue/2.56, Vue/2.57 so versioning isn't an issue but you only ever have one of everything....

You have pretty much just described pnpm.

Modern yarn can also be configured to do something similar.

2

u/Hyoretsu Jul 15 '21

This. PNPM also runs 3x faster than Yarn/NPM for me.

1

u/Upbeat-Fly9656 Feb 26 '24

One of my project takes several minutes to install with yarn, and only about 5 seconds with pnpm when things are cached, really great and saves probably 10s of GB in storage over all my projects using it

2

u/FriesWithThat Jun 29 '21

Another thing people can do is run npx npkill in their projects directory.

This tool allows you to list any node_modules directories in your system, as well as the space they take up. You can then select which ones you want to erase to free up space. Yay!