Ahmed Radwan
Ahmed Radwan

Reputation: 11

why node_modules are so heavy and python dependencies are light?

I am new to JavaScript and noticed when I install libraries using npm the node_modules folder is large and it's taking much time and that's not the case in python when I install Django or any library for example!

so how NodeJs is different from Python at installing packages?

I searched on Quora, YouTube, reddit and didn't found a clear comparison between both

Upvotes: 1

Views: 2492

Answers (1)

Jb31
Jb31

Reputation: 1391

npm uses local dependencies, so the same module is installed over and over again for every project and every transitive dependency. pip uses global dependencies (at least global to the virtualenv, if used) which avoids this.

Apart from that, pythons standard library is much more larger than the one found in javascript. Thus, much more packages are needed in JS compared to python. Additionally, aspects like transpilation (Babel) are more prevalent in JS than in python.

Upvotes: 2

Related Questions