npm install 用不需要的包填充 node_module

npm install fills node_module with unwanted packages

我正在尝试在本地项目上安装 Grunt,当 运行

    npm install grunt-contrib-watch

结果:

    sass-test username$ npm install grunt-contrib-watch --save-dev
    sass-test@1.0.0 /Users/username/Documents/WEB-DEV/sass-test
    └─┬ grunt-contrib-watch@1.0.0 
      ├── async@1.5.2 
      ├─┬ gaze@1.0.0 
      │ └─┬ globule@0.2.0 
      │   ├─┬ glob@3.2.11 
      │   │ ├── inherits@2.0.1 
      │   │ └── minimatch@0.3.0 
      │   ├── lodash@2.4.2 
      │   └─┬ minimatch@0.2.14 
      │     ├── lru-cache@2.7.3 
      │     └── sigmund@1.0.1 
      ├── lodash@3.10.1 
      └─┬ tiny-lr@0.2.1 
        ├─┬ body-parser@1.14.2 
        │ ├── bytes@2.2.0 
        │ ├── content-type@1.0.2 
        │ ├── depd@1.1.0 
        │ ├─┬ http-errors@1.3.1 
        │ │ └── statuses@1.3.0 
        │ ├── iconv-lite@0.4.13 
        │ ├─┬ on-finished@2.3.0 
        │ │ └── ee-first@1.1.1 
        │ ├── qs@5.2.0 
        │ ├─┬ raw-body@2.1.6 
        │ │ ├── bytes@2.3.0 
        │ │ └── unpipe@1.0.0 
        │ └─┬ type-is@1.6.13 
        │   ├── media-typer@0.3.0 
        │   └─┬ mime-types@2.1.11 
        │     └── mime-db@1.23.0 
        ├─┬ debug@2.2.0 
        │ └── ms@0.7.1 
        ├─┬ faye-websocket@0.10.0 
        │ └─┬ websocket-driver@0.6.5 
        │   └── websocket-extensions@0.1.1 
        ├── livereload-js@2.2.2 
        ├── parseurl@1.3.1 
        └── qs@5.1.0 

将上述所有软件包安装到 node_module 文件夹中,但安装 grunt 依赖项失败。如果这些包是某些其他已安装模块的依赖项,有没有办法找出这是什么?

我想我可能已经编辑了默认的包配置文件夹,但我对 npm 不太自信,无法确定。

有人有什么建议吗?

安装的依赖项与 NPM page 上显示的完全匹配。 G运行t 未列为依赖项。

记住 G运行t 是一项任务 运行ner。它可以想象 运行 您可以添加到 g运行t 文件中的任何任务,但这些任务不需要了解 G运行t 本身。

只需单独安装 G运行t 即可。