dependency-injectionnpmpackage

why does npm install dependences that are not listed in my package.json file?


I'm having trouble finding an answer to this problem.

tl;dr... I just ran npm update npm -g before starting a new Node/Express project. When I run npm install for this project, npm installs a ton of new dependencies that aren't listed in my package.json folder. I've never even seen many of these before.

What's going on here -- why is npm installing all these dependencies and how do I fix this?

I even tested npm install on an older project from last week and it did similar behavior.

ps - someone mentioned that even dependencies need dependencies. like this? http://puu.sh/ki1GW/cfead489ef.png


Solution

  • Yes, those are dependencies of your dependencies. Think of it like a tree structure, with your project as the root node. Everything in the tree needs to be downloaded.