What is the --save option for npm install?

前端 未结 12 725
野性不改
野性不改 2020-11-22 13:54

I saw some tutorial where the command was:

npm install --save

What does the --save option mean?

Not able to find the a

12条回答
  •  遇见更好的自我
    2020-11-22 13:55

    npm install --save or npm install --save-dev why we choose 1 options between this two while installing package in our project.

    things is clear from the above answers that npm install --save will add entry in the dependency field in pacakage.json file and other one in dev-dependency.

    So question arises why we need entry of our installing module in pacakge.json file because whenever we check-in code in git or giving our code to some one we always give it or check it without node-modules because it is very large in size and also available at common place so to avoid this we do that.

    so then how other person will get all the modules that is specifically or needed for that project so answers is from the package.json file that have the entry of all the required packages for running or developing that project.

    so after getting the code we simply need to run the npm install command it will read the package.json file and install the necessary required packages.

提交回复
热议问题