I just installed Gulp with the following commands:
npm install --global gulp
and
npm install --save-dev gulp
Everything works fine except my node_modules folder is now filled with modules I have never heard of. All the tutorials online about Gulp only show the Gulp module in this folder. For me it's the following:
node_modules folder
Question:
Is it normal for the node_modules folder to be having these modules?
Thank you in advance
What tried:
Updating gulp / node / npm
Versions:
gulp -v :
[13:45:13] CLI version 3.9.0
[13:45:13] Local version 3.9.0
npm -v : 3.3.9
node -v : v5.0.0
No, npm is a package manager. You only need to install it once in a system.
The global npm directory is where your packages get installed when you install them globally. You can check where it is by typing in npm root -g in the command line. For Mac users, if the root command returns a directory like /Users/YOURNAME/node_modules then this will cause the command not found error.
To install the Gulp CLI globally, on your command line, run npm install gulp-cli -g . The -g flag means npm will install the package in the global npm directory, so you can run the gulp command from any directory.
etc. and running with npm run test then you shouldn't need the global install at all. Both methods are useful for getting people set up with your project since sudo isn't needed. It also means that gulp will be updated when the version is bumped in the package.
this is due to the maximally flat dependency tree of npm 3. Instead of all the node_modules that gulp requires being installed in a node_modules folder within the gulp dependency, they are all installed in the root node_modules folder.
https://docs.npmjs.com/how-npm-works/npm3#npm-v3-dependency-resolution
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With