【问题标题】:npm install fills node_module with unwanted packagesnpm install 用不需要的包填充 node_module
【发布时间】:2016-06-08 08:06:39
【问题描述】:

我正在尝试在本地项目上安装 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 不太有信心,无法确定。

有人有什么建议吗?

【问题讨论】:

    标签: node.js npm gruntjs npm-install


    【解决方案1】:

    安装的依赖项与NPM page 上显示的完全匹配。 Grunt 没有被列为依赖项。

    请记住,Grunt 是一个任务运行器。它可以运行任何可以添加到 gruntfile 的任务,但这些任务不需要知道 Grunt 本身。

    只需单独安装 Grunt 即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-28
      • 2021-03-17
      • 2020-07-24
      • 1970-01-01
      • 1970-01-01
      • 2016-04-13
      • 1970-01-01
      相关资源
      最近更新 更多