James
James

Reputation: 11

Gulp: npm install gulp --save-dev was expecting to see just a gulp folder inside the node_modules folder

Wonder if someone can tell me if im doing something wrong?

  1. Downloaded Node from there website
  2. Installed Gulp globally (npm install --global gulp)
  3. Made a folder and inside ran (npm init) which makes the package.json file
  4. Installed gulp to the project (npm install --save-dev gulp)

This then adds gulp as a dependency inside package.json and creates a node_modules folder.

I was expecting to only see a gulp folder inside node_modules folder like so:

| node_modules
|-- gulp

But for some reason it's adding around 132 extra dependency folders, is this correct, should this happen? I would of thought these should be contained inside the gulp folder itself?

Upvotes: 1

Views: 313

Answers (1)

zerkms
zerkms

Reputation: 254926

npm since v3 puts almost all dependencies to the node_modules directly.

Your dependencies will now be installed maximally flat. Insofar as is possible, all of your dependencies, and their dependencies, and THEIR dependencies will be installed in your project's node_modules folder with no nesting. You'll only see modules nested underneath one another when two (or more) modules have conflicting dependencies.

References:

Upvotes: 0

Related Questions