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

查看:94
本文介绍了-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未安装
        • yourproject
          • dependency installed
            • dependency installed
              • dependency installed
              • devDependency NOT installed
              • 已安装依赖项
              • devDependency未安装

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

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