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

download = false

Open SkylerLutz opened this issue 4 years ago • 2 comments

Hi,

I don't fully understand this comment in the README: // If false, it will try to use globally installed node. download = true

Can someone explain in more detail what this means? Specifically:

  • Does nvm need to be installed on the host machine for download = false to work?
  • Does it try to use the version specified in the version field?
  • How does it "try"?
  • What happens if "trying" fails?

Thanks

SkylerLutz avatar Feb 04 '21 14:02 SkylerLutz

If you set download to true this plugin will download node and npm using the versions provided in the configuration, if you set it to false you need to have the tools installed and on PATH, nvm is probably one of the easier ways to do that.

If it fails an error message will be printed, detailing the failure and failing the build. You can try this by setting version to some invalid value.

However, this plugin is currently unmaintained, there's a fork (without the grunt/gulp support) and the full history is available at this issue https://github.com/srs/gradle-node-plugin/issues/315

deepy avatar Feb 04 '21 15:02 deepy

Thanks for that, @deepy -- I'll switch over to the fork. Follow up question on nvm: how would I go about running nvm use x.x.x from gradle?

SkylerLutz avatar Feb 11 '21 21:02 SkylerLutz