srs/gradle-node-plugin

Plugin reinstalls node every run?

virgo47 opened this issue · 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, do you have multimodule project?

I explained existing bug here: #256 (comment)

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.