node-gradle / gradle-node-plugin

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

Specified node version not downloaded #169

Closed craigklem closed 3 years ago

craigklem commented 3 years ago

On Windows 10, using gradle 6.8.1 and latest plugin 3.0.1 with configuration of: node { download = true version = "12.22.1" } Plugin does not seem to download version 12 but rather seems to use create .gradle\nodejs\node-v14.15.4-win-x64 I do have 14.15.4 installed locally but need to target older releases for various builds.

deepy commented 3 years ago

I tested with the simple-node example with the following modifications:

    download = true
    version = '14.14.0'
}

and console.log(process.version); as the script.

I get the following output:

PS C:\dev\gradle-node-plugin> node --version
v14.16.0
PS C:\dev\gradle-node-plugin> node .\examples\simple-node\hello.js
v14.16.0
PS C:\dev\gradle-node-plugin> .\gradlew -p examples\simple-node helloWorld

> Task :helloWorld
v14.14.0

and I see the expected version in .gradle\nodejs, can you make a simple test-case showing it misbehaving using the example in examples\simple-node?

craigklem commented 3 years ago

Running with --debug I do see it downloaded. Thanks.