10
gitpush
7y

I'm no Nodejs expert but can someone explain how in the fucking world is node_modules folder is that HUGE! on my slow ass internet it takes couple of mins to pull the repo and five mins to finish npm install! and takes so much ram to build a freaking docker container for my react website when it takes barely 300MB to build both MySQL and Asp.Net Core dockers T_T

Comments
  • 2
    I'm a node.js noob and I want to know this, too. ⚓
  • 3
    Node.js is famous for its dependency hell. Much criticism comes from forcing modularization to things that do not really require ro be modularized which in the end make up for their own place as a retarded project dependency. We are getting rid of that weird mentallity but it is still there sadly.
  • 1
    @AleCx04 this is sad bro, though the next bad thing when it comes to dependencies is Pod for iOS, at work our IPA file is 150MB, and 110MB are only for Pods, we ended up removing some pods and adding them directly to the project though in this case we lose update feature and have to manually update its code sadly.
  • 1
    @gitpush I can relate with you, Dude ahaha
  • 2
    There are some additional things to say, for example...
    Some node.js modules aren't minified which means that you get all the files with details when asking for dependencies.
    If you aren't using some strategy related to bundles, some modules will depend on the same module and you end with the same package in different locations (very dumb, yarn is trying to fix this)
    If module X depends on Y in version 1 and module Z depends on Y in version 1.1 you'll end up with both version in your node_modules (even when X could use Y in version 1.1)

    But the community is hard working to fix this problems and I hope they do it.
  • 1
    @sierisimo interesting, I need to read more about that so I don't fall into this issue. Any minify recommended or when I run npm publish (or whatever it was) it handled it?
  • 0
    @DLMousey infinite loop 😅
Add Comment