3
Xoka
52d

I'm really frustrated by the size of node_modules folder that gets created every time for every project. So, I've been looking for some time-space saving solutions. And I found PNPM ( https://pnpm.js.org/ ) , Yarn ( https://yarnpkg.com/ ) and Pkglink ( https://github.com/jeffbski/pkglink ). But I'm not sure which is better to serve my purpose.

Things I'm looking forward to solving:

1. I don't want to re-download the same packages over and over again
2. I don't want the same packages to be in multiple projects and eat up space
3. I want a stable, fast and disk space saving solution

Looking for experts advice.

Comments
  • 0
    Can't give advice there, just leaving a tip on checking out Deno, it does away with node_modules. It still isn't prod ready but maybe some of your projects could run in deno instead.
  • 0
    not sure if you can avoid downloading at least once mate but will pop a beer for your soul if you figure something along the lines of "shared modules dir" out and share here
  • 1
    @molaram downloading once, thats okay. But downloading over and over again, that's what I want to solve. if you have any solution like that, please let us know
  • 0
    @Xoka shared mod dir over nfs or some shit? local mirror might be too complicated?

    https://nodejs.org/api/...

    i haven't played with this, I could be wrong, but could it work? just make a dumping ground on some NFS share and mount to node_modules in each project?
  • 0
    @molaram I tried that and its fucking slow. Takes life time to compile a simple line changes.
  • 0
    @Xoka that's odd, what kinda net hardware you packing? I have a 15 gb rails app loading from EFS on a shit ton of instances, works like a charm
  • 0
    I am looking forward to npm 8 or something, I think I read somewhere that this should be a solved problem in the futute.
Add Comment