srs / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
867 stars 210 forks source link

NPM Cache Config fails on second run #348

Closed oobles closed 4 years ago

oobles commented 4 years ago

plugins { id "com.moowork.node" version "1.3.1" } task npmCacheConfig(type: NpmTask) { description = "Configure the NPM cache" def npmCacheDir = "${gradle.getGradleUserHomeDir()}/caches/npm/" outputs.files file(npmCacheDir) args = ['config', 'set', 'cache', npmCacheDir] }

When using a npmCacheConfig task like above using Gradle 5.5.1 we get the following error on the second run. The first run successfully creates and uses the directory, however, the second run fails.

Is there a different method that should be used for configuring the NPM cache?

deepy commented 4 years ago

Shouldn't that be outputs.dir rather than outputs.files?

oobles commented 4 years ago

Yes. That was it! Thanks, was staring at it all day and knew it should be something simple.