srs / gradle-node-plugin

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

Unable to download node with version 5.X.Y using the plugin #310

Open alphaho opened 5 years ago

alphaho commented 5 years ago

Hi,

I've found the plugin fails to setup node correctly in windows when I set the version to 5.X.Y as follows:

node {
    version = "5.1.0"
    download = true
}

After running the nodeSetup task, only node_modules/npm shown in the folder node-v5.1.0-win-x64(have ommitted the files within the npm folder), while there should be node.exe in it as well:

{ gradle-node-plugin-sample } master » tree .gradle/nodejs -L 3
.gradle/nodejs
└── node-v5.1.0-win-x64
    └── node_modules
        └── npm

3 directories, 0 files

Even though gradle says the task has finished successfully:

{ gradle-node-plugin-sample } master » ./gradlew nodeSetup
> Task :nodeSetup

BUILD SUCCESSFUL in 9s
1 actionable task: 1 executed
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

However, if I update the version to 6.X.Y or using the default version(6.9.1) from the plugin, it can get the node.exe correctly:

{ gradle-node-plugin-sample } master » tree .gradle/nodejs -L 3
.gradle/nodejs
└── node-v6.9.1-win-x64
    ├── CHANGELOG.md
    ├── LICENSE
    ├── node.exe
    ├── node_etw_provider.man
    ├── node_modules
    │   └── npm
    ├── node_perfctr_provider.man
    ├── nodevars.bat
    ├── npm
    ├── npm.cmd
    └── README.md

3 directories, 9 files

Here's the sample project I've created to reproduce the issue: https://github.com/alphaho/gradle-node-plugin-sample

I'm using Windows 10 (Version 1709, OS Build 16299.611) with Gradle 4.10.1 + gradle-grunt-plugin 1.2.0

May I know whether it's not suuporting Nodejs with version 5.X.Y? As our project is tied up to that version, it would help a lot if we can make it work!

Thanks in advance!