gradle-node-plugin icon indicating copy to clipboard operation
gradle-node-plugin copied to clipboard

Plugin reinstalls node every run?

Open virgo47 opened this issue 5 years ago • 2 comments

Hi We used configuration like this:

node {
	version = versionNodejs
	npmVersion = versionNpm

	distBaseUrl = 'https://nodejs.org/dist'
	download = true
	workDir = file("${toolsDir}/nodejs")
	npmWorkDir = file("${toolsDir}/npm")
}

Today we noticed that the build complained it can't remove node.exe when we tried it on our local Windows machine. We were surprised. Why does it want to remove exisitng EXE file? We checked our CI server and, indeed, node installation has fresh timestamps from the last build. Why does this happen? Can't it just check it's there already? Is it intentional, or are we doing something wrong?

virgo47 avatar Apr 09 '19 15:04 virgo47

@virgo47, do you have multimodule project?

I explained existing bug here: https://github.com/srs/gradle-node-plugin/issues/256#issuecomment-477932029

imanushin avatar Apr 12 '19 15:04 imanushin

I do have a multimodule project, but only one Gradle project (module) uses the plugin. However we decided to manage our environment with shell script, so now we manage Node+NPM (alongside Java home as well) outside of Gradle, set it to path and use the plugin without node configuration, as it finds expected Node+NPM.

So we walked around the problem with the benefit of having script for setting up our environment for subsequently running npm from the command line which is handy for normal development + faster than running the same command with Gradle.

virgo47 avatar Apr 13 '19 09:04 virgo47