【问题标题】:Transitive grunt plugin dependencies?传递 grunt 插件依赖项?
【发布时间】:2013-02-11 19:59:26
【问题描述】:

我有一个名为 snorky 的 grunt 插件,它依赖于 grunt-compass 任务。当有人键入npm install git://path/to/snorky 时,我希望自动安装grunt-compass 任务。

package.json

{
  "name": "snorky",
  // ...
  "dependencies": {
    "bower": "~0.7.0",
    "grunt-compass": "~0.3.8"
  }
}

tasks.snorky.js

module.exports = function(grunt) {

  grunt.loadNpmTasks('grunt-compass');

  // ...

}

但是,当我从另一个项目 npm install snorky,然后尝试运行 grunt snorky 时,我得到一个错误:

user.name:~/other/proj [git: my-branch] $ grunt snorky
>> Local Npm module "grunt-compass" not found. Is it installed?

这样做的正确方法是什么?我怀疑是否有必要从使用 snorky 的项目中 npm install grunt-compass

【问题讨论】:

  • 你使用的是什么版本的 grunt?

标签: gruntjs


【解决方案1】:

https://npmjs.org/package/grunt-compass

该软件包表示它已被 grunt 0.4 弃用,并且其 travisci 构建失败。

在安装说明下也写着

  1. 在项目的 grunt.js gruntfile 旁边安装这个 grunt 插件:npm install grunt-compass

所以也许只需要运行 npm 安装。

您应该尝试使用grunt-contrib-compass

它的构建是成功的,它适用于 0.4

【讨论】:

    猜你喜欢
    • 2013-04-22
    • 2014-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-17
    • 1970-01-01
    • 2016-02-23
    • 1970-01-01
    相关资源
    最近更新 更多