安装所有NodeJS模块

时间:2016-07-30 12:41:37

标签: webstorm

在我的WebStorm NodeJS项目中,我有package.json这个内容:

{
  "name": "application-name",
  "version": "0.0.1",
  "scripts": {
    "main": "node $NODE_DEBUG_OPTION ./app-compiled.js"
  },
  "dependencies" : {
    "gulp" : "latest",
    "body-parser" : "latest"

  }
}

当我在项目的根目录中执行npm install时,会安装几十个模块(请参阅:http://take.ms/Iavqh),而我希望只安装2个模块。

enter image description here

  1. 为什么要安装所有这些模块?如果只安装2个模块,我该怎么办?

  2. npm install创建一个具有“库根”符号的node_modules文件夹。这是什么意思?

1 个答案:

答案 0 :(得分:2)

因为这些是gulp的依赖性。如果你打开gulp文件,你会看到很多var someName = require('');这称为依赖性。 npm install是一个递归安装。

相关问题