D
D
Donald_Duck2018-02-24 18:30:04
npm
Donald_Duck, 2018-02-24 18:30:04

Why are --save-prod and --save-dev needed, what is their practical essence?

Good day! I can't understand why --save-dev and --save-prod are needed, other than that they write dependencies in dependencies and devDependencies respectively. At first I thought that in devDependencies only packages that are needed in the development process, for example, gulp, are indicated, and in dependencies the packages that will be needed in production will also be indicated. But npm install still installs all packages from both dependencies and devDependencies . Tried npm install -P and npm install -Dnothing changes, all packages are installed anyway. Please help me understand...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-02-24
@Donald_Duck

Correct like this:

npm install --only=prod
npm install --only=production

npm install --only=dev
npm install --only=development

npm install

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question