admin管理员组文章数量:1296400
From the documentation, .md
$ npm install --save-dev gulp
All the npm modules which I have used so far installs using $ npm install --save <module_name>
Why --save-dev
for gulp and not just --save
? What is the difference between --save-dev
and --save
?
From the documentation, https://github./gulpjs/gulp/blob/master/docs/getting-started.md
$ npm install --save-dev gulp
All the npm modules which I have used so far installs using $ npm install --save <module_name>
Why --save-dev
for gulp and not just --save
? What is the difference between --save-dev
and --save
?
- May I ask why the negative vote? What is wrong with the question? – guagay_wk Commented Nov 14, 2015 at 6:37
- I guess because of: stackoverflow./questions/27897038/why-need-npm-save-dev – weirdpanda Commented Nov 14, 2015 at 6:41
- 1 have a look at stackoverflow./questions/19223051/… – Don Commented Nov 14, 2015 at 6:42
- I believe someone voted your question down (most probably) because the question already exists (with an answer) and insufficient research was done before posting this question. Thats my guess – Don Commented Nov 14, 2015 at 6:44
- My question asks why not just --save? Some difference. – guagay_wk Commented Nov 14, 2015 at 6:45
2 Answers
Reset to default 9--save
adds the package to your dependency list ("dependencies" in package.json). This is a list of only the dependencies that your package needs to run. These are the dependencies that need to be installed when a user installs your package from npm with the intent of using it.
--save-dev
adds the package to your developer dependency list ("devDependencies" in package.json). This is a list of dependencies that you need only for developing the package. Examples would be like babel, gulp, a testing framework, etc.
For more information, check out the top two linked questions to this one:
- Grunt.js: What does -save-dev mean in npm install grunt --save-dev
- What is difference between --save and --save-dev?
This is a duplicate question. Answer can be found here. Grunt.js: What does -save-dev mean in npm install grunt --save-dev
Copy from the other link.
There are (at least) two types of package dependencies you can indicate in your package.json files:
1) Those packages that are required in order to use your module are listed under the "dependencies" property. Using npm you can add those dependencies to your package.json file this way:
npm install --save packageName
2) Those packages required in order to help develop your module are listed under the "devDependencies" property. These packages are not necessary for others to use the module, but if they want to help develop the module, these packages will be needed. Using npm you can add those devDependencies to your package.json file this way:
npm install --save-dev packageName
本文标签: javascriptWhy does gulp need to be installed with savedev and not just saveStack Overflow
版权声明:本文标题:javascript - Why does gulp need to be installed with --save-dev and not just --save - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741637115a2389703.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论