What do the --save flags do with npm install

后端 未结 3 1432
遇见更好的自我
遇见更好的自我 2021-01-30 09:46

I see instructions to install a package with either

npm install 

or

npm install  --save         


        
3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 10:18

    npm install --save installs the package and updates the dependencies in your package.json. Since this question was asked there was a change to npm, such that --save has become the default option, so you do not need to use --save to update the dependencies.

    npm install --no-save installs the package but does not update the dependencies as listed in your package.json.

    npm install ---save-dev updates the devDependencies in your package. These are only used for local testing and development.

    You can read more at https://docs.npmjs.com/getting-started/using-a-package.json.

提交回复
热议问题