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.
What went wrong:
A problem was found with the configuration of task ':some-project:npmCacheConfig'.
Cannot write to file '/.../caches/npm' specified for property '$1' as it is a directory.
Is there a different method that should be used for configuring the NPM cache?
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?