A
A
Artem Skopintsev2016-03-30 19:25:59
npm
Artem Skopintsev, 2016-03-30 19:25:59

Why is npm ignoring the --save-dev switch (installing Gulp)?

Good time of the day.
I installed Gulp globally (--global), everything went well. I created a new project, did npm init(created package.json), then I do the following: npm install --save-dev gulp. But Gulp, instead of being installed as a dependency and creating directories "node_modules/.bin", "node_modules/gulp", installed completely, all 4Mb were installed in the project folder, all its source code. What is the reason? How to fix?
Thank you in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Belyaev, 2016-03-30
@bingo347

npm install <package or list of packages separated by a space>
always installs packages in a local directory (exception - option --global or shortly -g)
option --save-dev (or shortly -D) tells to also save the dependency in package.json in devDependencies section
option --save (-S) saves the dependency to the dependencies section the only
difference is that executing npm install without options will install all dependencies from dependencies but not from devDependencies which is very convenient when deploying an application to production

A
Andrey, 2016-03-30
@svistiboshka

This is fine

A
amf1k, 2016-03-30
@amf1k

npm install gulp --save-dev

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question