S
S
sinevik2018-02-18 17:37:13
Node.js
sinevik, 2018-02-18 17:37:13

Npm install --save flag, how does it work?

igeuef
How is installing with the --save flag different from installing without this flag?
After all, everything is written in package.json anyway?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Ygine31, 2019-02-13
@sinevik

Imagine a cake, for its preparation the chef needs products, they will be included in the composition of the cake. But for cooking, you will also need tools like bowls, spoons, spatulas, etc. And in the kitchen there are tables and stoves, refrigerators, etc., which is used to prepare any dish, common tools that are in the kitchen.
It's the same with project dependencies - some will be used in the resulting product, others are needed only at the development stage, and there are some that need to be used regardless of the project.
--save - indicates that a dependency is added that will be included in the final product. The package will be installed locally, in the node_modules folder, and an entry will be added to the dependencies field in package.json.
--save-dev Indicates that a development dependency is being added. The package will be installed locally, in the node_modules folder, and an entry will be added to the devDependencies field in package.json.
Written 40 minutes ago

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question