-save-dev 在 npm install grunt --save-dev 中是什么意思 [英] What does -save-dev mean in npm install grunt --save-dev

查看:38
本文介绍了-save-dev 在 npm install grunt --save-dev 中是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用 Grunt.js.设置起来非常困难,我正在创建一个 package.json 文件.

I've just started using Grunt.js. It is pretty hard to set up and I am at the point of creating a package.json file.

按照这个教程,它说有 3 种方法可以创建package.json 文件.

Following this tutorial, it says there are 3 ways to create a package.json file.

首先是做npm install grunt --save-dev

但是 --save-dev 是什么意思? 我尝试寻找,但没有结果.

But what does --save-dev means? I tried looking but it ends in vain.

推荐答案

--save-dev:包将出现在您的 devDependencies 中.

--save-dev: Package will appear in your devDependencies.

根据 npm 安装文档.

如果有人计划在他们的程序中下载和使用您的模块,那么他们可能不想或不需要下载和构建您使用的外部测试或文档框架.

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.

换句话说,当你运行 npm install 时,你的项目的 devDependencies 会被安装,但是你的应用所依赖的任何包的 devDependencies 都不会被安装;此外,将您的应用程序作为依赖项的其他应用程序不需要安装您的 devDependencies.只有在开发应用程序时才需要这些模块(例如 grunt、mocha 等).

In other words, when you run npm install, your project's devDependencies will be installed, but the devDependencies for any packages that your app depends on will not be installed; further, other apps having your app as a dependency need not install your devDependencies. Such modules should only be needed when developing the app (eg grunt, mocha etc).

根据 package.json 文档

  • 您的项目
    • 已安装依赖项
      • 已安装依赖项
        • 依赖安装
        • devDependency 未安装
        • 依赖安装
        • devDependency 未安装

        这篇关于-save-dev 在 npm install grunt --save-dev 中是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆