What is the difference between --save and --save-dev?

后端 未结 13 767
旧巷少年郎
旧巷少年郎 2020-11-28 00:02

What is the difference between:

npm install [package_name]

and:

npm install [package_name] --save

and:

相关标签:
13条回答
  • 2020-11-28 00:48

    As suggested by @andreas-hultgren in this answer and according to the npm docs:

    If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.

    However, for webapp development, Yeoman (a scaffolding tool that installs a peer-reviewed, pre-written package.json file amongst other things) places all packages in devDependencies and nothing in dependencies, so it appears that the use of --save-dev is a safe bet in webapp development, at least.

    0 讨论(0)
提交回复
热议问题