shama / letswritecode

:mortar_board: code examples for Let's Write Code
https://www.youtube.com/user/kylerobinsonyoung
806 stars 758 forks source link

Why does my node_modules folder have so much more stuff than yours? #22

Open binarybill opened 6 years ago

binarybill commented 6 years ago

It seems like for every project I make it has to download so much stuff.

Also fyi, when I do "npm i browserfy" it gives a warning about fsevents. I think because fsevents is only for mac systems and I am using linux for development.

And thanks for your awesome tutorials !!

shama commented 6 years ago

It's likely the version of npm I was using at the time in the video. Previous versions of npm would nest dependencies more often:

node_modules/
  parent_module/
    node_modules/
      child_module/

Due to npm being used more for front end and other reasons, compatible modules are moved to the top level folder now with newer versions of npm:

node_modules/
  parent_module/
  child_module/

So it looks like more but it's the same. It was just more hidden in child node_module folders in the past.