DEV Community

Discussion on: why does NPM install extra modules?

Collapse
 
connorphee profile image
Connor Phee

Hamza,

The reason for all of those extra modules is that Express depends on those. If you check out Express on NPM: npmjs.com/package/express

you can see the dependency list on the right side of the page matches those extra packages in your node_modules.

This is common for larger packages since it is much easier to find an existing package that solves a problem, rather than having to write it from scratch, similar to how you're using Express to simplify/abstract some things.

Also worth noting: Not only are the dependencies of Express installed, but also the dependencies of the dependencies, and that goes for every level until every needed package exists.

Hope this helps!

Collapse
 
salahhamza profile image
Hamza

I couldn't find a simpler answer, you really explained everything I wanted to know and some more.
Thank you so much Connor