npm express install 正在添加额外的依赖项

npm express install is adding extra dependancies

当我 cd 进入我的项目并 npm install express --save 时,它​​不仅将 express 注入我的 node_modules,而且还安装了许多我不需要或不想要的其他依赖项。我试图卸载并重新安装节点和 npm。我正在使用自制软件来安装节点。谁能帮我理解为什么会这样?

npm install express --save

 ─┬ express@4.13.4 
  ├─┬ accepts@1.2.13 
  │ ├─┬ mime-types@2.1.9 
  │ │ └── mime-db@1.21.0 
  │ └── negotiator@0.5.3 
  ├── array-flatten@1.1.1 
  ├── content-disposition@0.5.1 
  ├── content-type@1.0.1 
  ├── cookie@0.1.5 
  ├── cookie-signature@1.0.6 
  ├─┬ debug@2.2.0 
  │ └── ms@0.7.1 
  ├── depd@1.1.0 
  ├── escape-html@1.0.3 
  ├── etag@1.7.0 
  ├─┬ finalhandler@0.4.1 
  │ └── unpipe@1.0.0 
  ├── fresh@0.3.0 
  ├── merge-descriptors@1.0.1 
  ├── methods@1.1.2 
  ├─┬ on-finished@2.3.0 
  │ └── ee-first@1.1.1 
  ├── parseurl@1.3.1 
  ├── path-to-regexp@0.1.7 
  ├─┬ proxy-addr@1.0.10 
  │ ├── forwarded@0.1.0 
  │ └── ipaddr.js@1.0.5 
  ├── qs@4.0.0 
  ├── range-parser@1.0.3 
  ├─┬ send@0.13.1 
  │ ├── destroy@1.0.4 
  │ ├─┬ http-errors@1.3.1 
  │ │ └── inherits@2.0.1 
  │ ├── mime@1.3.4 
  │ └── statuses@1.2.1 
  ├── serve-static@1.10.2 
  ├─┬ type-is@1.6.11 
  │ └── media-typer@0.3.0 
  ├── utils-merge@1.0.0 
  └── vary@1.0.1 

您可能 运行 npm 版本 3 或更高版本。这个版本使得依赖项的所有依赖项都存储在根 node_modules 文件夹中。

查看此处了解更多信息:https://github.com/npm/npm/releases/tag/v3.0.0

Your dependencies will now be installed maximally flat. Insofar as is possible, all of your dependencies, and their dependencies, and THEIR dependencies will be installed in your project's node_modules folder with no nesting. You'll only see modules nested underneath one another when two (or more) modules have conflicting dependencies.

这很正常,您要安装的模块必须有自己的依赖项才能正常工作,因此它们会同时安装在您的 node_modules