srs / gradle-gulp-plugin

Gradle plugin for running Gulp tasks
70 stars 9 forks source link

npmInstall Task Error - Cannot find module npm-cli.js #9

Open HieronyM opened 9 years ago

HieronyM commented 9 years ago

Dear @srs,

It such a great plugin you make to enable usage of Gulp in Gradle. But i'm hitting the wall when implement gulp in my build script.

Here's my build script

plugins {
    id "com.moowork.gulp" version "0.10"
}

apply plugin: 'groovy'
apply plugin: 'com.moowork.gulp'

defaultTasks 'clean', 'build'

def srcDir = new File(projectDir, "web")
def targetDir = new File(project.buildDir, "web")
gulp_build.inputs.dir srcDir
gulp_build.outputs.dir targetDir

// makes sure on each build that gulp is installed
gulp_build.dependsOn 'installGulp'

// processes your package.json before running gulp build
gulp_build.dependsOn 'npmInstall'

// runs "gulp build" as part of your gradle build
build.dependsOn gulp_build

When I try command gradle clean build, I got error that say it cannot find module npm-cli.js I am new in Gulp, please help me figure out what's wrong in my configurations.

Thanks.

srs commented 9 years ago

Hi.

Can you try to add the following right after the plugins-clause?

node {
  download = true
}
HieronyM commented 9 years ago

Hi @srs

I have added it, problem solved. Anyway, I have Question what is the function of the package.json file? And what configuration must added to package.json file?

Thanks.