Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading node to version 12.15.0 build failure #365

Open
induja0107 opened this issue Feb 7, 2020 · 9 comments
Open

Upgrading node to version 12.15.0 build failure #365

induja0107 opened this issue Feb 7, 2020 · 9 comments

Comments

@induja0107
Copy link

I tried changing node version to 12.15.0 and the build fails. 12.13.1 version of node works fine. Does the gradle-node-plugin need to be updated to support latest node version? Or is there a way i can use the 12.15.0 using the 1.1.0 of the gradle-node-plugin?

@deepy
Copy link

deepy commented Feb 7, 2020

How did the build fail?
I can't think of anything that should break

@Kobe
Copy link

Kobe commented Feb 9, 2020

it fails with latest Gradle 6.x release for every node.js version since 12.x

* What went wrong:
Execution failed for task ':nodeSetup'.
> Could not resolve all files for configuration ':detachedConfiguration1'.
   > Could not find org.nodejs:node:12.15.0.
     Searched in the following locations:
       - https://nodejs.org/dist/v12.15.0/ivy.xml
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings

but it works with latest 5.x release

@allnightlong
Copy link

Same problem here

@Kobe
Copy link

Kobe commented Feb 10, 2020

I found a solution / workaround last night. It's using node-gradle plugin to download node/yarn/npm but on top of that gradle-node-plugin tasks.

import com.moowork.gradle.node.yarn.YarnTask

plugins {
    id("com.github.node-gradle.node") version "2.2.1"
}

repositories {
    jcenter()
}

node {
    // PLEASE use node LTS version or version with even major number
    version = "12.15.0"
    yarnVersion = "1.22.0"
    download = true
}

tasks {
    val build by registering(YarnTask::class) {
        dependsOn("yarn_install")
        args = listOf("build")
    }
}

@deepy
Copy link

deepy commented Feb 10, 2020

The problem is (or at least should be) Gradle 6.x, not the node version, you can see #315 for more information about the issue.
There's multiple issues/PRs about the lack of Gradle 6 support.

The plugin you're using in the solution is the fork available at https://github.com/node-gradle/gradle-node-plugin which should work fine with all available Gradle versions ;-)

@Kobe
Copy link

Kobe commented Feb 11, 2020

@deepy I didn't find any fork hints or something like that so I assumed it's a different plugin.

Do I need import com.moowork.gradle.node.yarn.YarnTask or is there another solution?

@deepy
Copy link

deepy commented Feb 12, 2020

The fork should work fine without any workarounds, I don't think you need to import YarnTask to get this to work, simply changing to id("com.github.node-gradle.node") version "2.2.1" should be fine

@Kobe
Copy link

Kobe commented Mar 26, 2020

I don‘t think so due to you need to import YarnTasks.

T0-B1 added a commit to T0-B1/PPS-19-riskala that referenced this issue Aug 30, 2020
@Jensen-Mourat
Copy link

Added a fork with the fix for those using earlier gradle versions (Tested with gradle 2.11).

https://github.com/Jensen-Mourat/gradle-node-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants