Skip to content

Could not ind ivy.xml #292

Open
Open

Description

@jchapelle

When trying to install node, yarn and npm with this configuration

node {
    download = true
    version = '8.9.1'
    distBaseUrl = 'https://nodejs.org/dist'
    npmVersion = '5.5.1'
    yarnVersion = '1.5.1'
    nodeModulesDir = file("${project.projectDir}")
}

The following error is received
Could not get resource 'https://nodejs.org/dist/v8.9.1/ivy.xml'.

Indeed, no ivy.xml file exist on nodejs.org website. What's wrong here ? How to fix ?

Activity

  1. f3rdy commented on May 15, 2018

    @f3rdy

    Could you please give more info on

    • which gradle version you use
    • how your build.gradle looks like
    • complete output
  2. VBourdine commented on May 25, 2018

    @VBourdine

    I have the same issue. There you go my build.gradle:

    plugins {
        id "com.moowork.node" version "1.2.0"
    }
    
    node {
        distBaseUrl = 'https://nodejs.org/dist'
        version = '8.11.2'
        download = true
    }
    

    I am trying to run just nodeSetup behind the proxy. The Output looks like:

    14:47:41: Executing task 'nodeSetup'...
    
    > Task :nodeSetup
    > Task :nodeSetup FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':nodeSetup'.
    > Could not resolve all files for configuration ':detachedConfiguration1'.
       > Could not resolve org.nodejs:node:8.11.2.
         Required by:
             project :
          > Could not resolve org.nodejs:node:8.11.2.
             > Could not get resource 'https://nodejs.org/dist/v8.11.2/ivy.xml'.
                > Could not GET 'https://nodejs.org/dist/v8.11.2/ivy.xml'.
                   > Connect to nodejs.org:443 [nodejs.org/104.20.23.46, nodejs.org/104.20.22.46] failed: Connection timed out: connect
    
    * 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
    
    BUILD FAILED in 50s
    1 actionable task: 1 executed
    Connection timed out: connect
    14:48:32: Task execution finished 'nodeSetup'.
    
  3. immanuel-kirubaharan commented on Aug 24, 2018

    @immanuel-kirubaharan

    I'm also facing the same kind of issue, any solution/update on this would be great?

  4. liamsteele commented on Sep 18, 2018

    @liamsteele

    This is definitely a proxy issue. It's silently failing to get the dist zip and falling back to trying to get ivy.xml which doesn't exist.

    For me, all my proxy settings were correct, but px was timing out for some mysterious reason. Swapping back to using cntlm worked. Using the proxy directly would also likely work.

  5. aollag09 commented on Mar 19, 2019

    @aollag09

    Hi there,

    Same problem on my side :(
    Any idea how to solve this issue ? This ivy.xml seems to no longer exist in nodejs.org/dist ...

    Thanks for your help :) !

    14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':nodeSetup'. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve all files for configuration ':detachedConfiguration1'. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve org.nodejs:node:8.11.2. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Required by: 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] project : 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve org.nodejs:node:8.11.2. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not get resource 'https://nodejs.org/dist/v8.11.2/ivy.xml'. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not GET 'https://nodejs.org/dist/v8.11.2/ivy.xml'. 14:37:07.077 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExcepti on: unable to find valid certification path to requested target

  6. dhakehurst commented on Jul 9, 2019

    @dhakehurst

    any progress on this ?

  7. liamsteele commented on Jul 12, 2019

    @liamsteele

    There's not much to do here, it's a proxy issue on your end.

    The only progress that could be made on this issue is adding better logging/error messages when it occurs.

  8. judos commented on Nov 22, 2019

    @judos

    Had the same issue on one project, other project worked. Only difference was gradle wrapper version.
    I now reverted the newer project from gradle 6.0 to gradle 4.10.3 and that works fine ;)
    To change gradle wrapper version in your project you can use this cmd:
    gradle wrapper --gradle-version=4.10.3

    So I think this is related to the ticket: #351

    Also note: ivy.xml was a fallback and does not actually exist (saw that when checking the older project where it works for me.)
    And secondly "proxy issue" doesn't make sense. Otherwise it would work for all or no projects on the same machine, which is not the case for me.

    Hope that gives some insight to many devs suffering from this issue.

  9. daggerok commented on Dec 5, 2019

    @daggerok

    are there some plans to fix it?

  10. tdennler commented on Dec 6, 2019

    @tdennler

    I have seen this issue as well. The problem is related to some optimization in the gradle repository resolution logic. In gradle 6 the default behavior is to look only for metadata files and not the actual artifact (which is a second HTTP Get). The old behavior can be restored with some additional configuration to the repository definition.

    The issue with the node plugin is that for fetching the node artifacts the repository definition is somewhat hard coded in com.moowork.gradle.node.task.SetupTask.addRepository method, which will remove all configured repos for the project, set in a specific repo to use for node resolution, and will restore the project repos later when node is resolved. To restore the old gradle resolution behavior requires a change like the following to this code to have gradle search for both the ivy metadata or the artifact (note the metadataSources enclosure).

        this.repo = this.project.repositories.ivy {
            url distUrl
            layout 'pattern', {
                artifact 'v[revision]/[artifact](-v[revision]-[classifier]).[ext]'
                ivy 'v[revision]/ivy.xml'
            }
            metadataSources {
                ivyDescriptor()
                artifact()
            }
        }
    

    When I added this hack to a copy of the node plugin code and rebuilt it, I was able to get past this issue.

    Another solution would be to get the ivy metadata file added for the node artifact in the repo hard coded in the gradle plugin: https://nodejs.org/dist (or point to a repo that has the missing ivy descriptor for this artifact).

  11. deepy commented on Dec 7, 2019

    @deepy

    The reason we forked this is because of Gradle 5+ compat, if you can live without grunt/gulp (or can use NpxTask to run them) there's https://github.com/node-gradle/gradle-node-plugin

  12. daggerok commented on Dec 7, 2019

    @daggerok

    Hello,

    Thank you @deepy for solution! I can confirm that this:

    plugins {
        // id("com.moowork.node") version "1.3.1"
        id("com.github.node-gradle.node") version "2.2.0"
    }
    
    node {
        download = true
        version = "12.13.1"
        npmVersion = "6.9.0"
        yarnVersion = "1.17.3"
        nodeModulesDir = project.file("ui")
        workDir = project.file("${project.buildDir}/nodejs")
        npmWorkDir = project.file("${project.buildDir}/npm")
        yarnWorkDir = project.file("${project.buildDir}/yarn")
    }

    and these tasks are working as expected on Gradle 6.0.1:

    ./gradlew nodeSteup
    ./gradlew npmSteup
    ./gradlew npm_i
    ./gradlew npm_run_build

    Regards,
    Maksim

  13. added a commit that references this issue on Feb 11, 2020
  14. added a commit that references this issue on Feb 20, 2020
  15. MrException commented on Apr 6, 2020

    @MrException

    Thank you @deepy for solution!

  16. petrabrunner commented on Apr 15, 2020

    @petrabrunner

    can confirm that @deepy's solution also worked for me. thx!
    Thx @daggerok for testing and posting!

  17. Yachin commented on Apr 24, 2020

    @Yachin

    The reason we forked this is because of Gradle 5+ compat, if you can live without grunt/gulp (or can use NpxTask to run them) there's https://github.com/node-gradle/gradle-node-plugin

    Hi, what should I do if our project use gulp?
    apply plugin:'com.moowork.gup' node{ download = true version='11.15.0' }

    It cannot find ivy.xml and node-v11.15.0-linux-x86.tar.gz
    I am running on Windows 10 with JDK 8 (64 bit) and JAVA runtime (64 bit)

    Thank you.

  18. deepy commented on Apr 24, 2020

    @deepy

    How reliant on gulp are you? Could you use gulp through npx as a workaround?

  19. Yachin commented on Apr 24, 2020

    @Yachin

    How reliant on gulp are you? Could you use gulp through npx as a workaround?

    @deepy
    The project used to run fine for my Windows machine. Till we added

    • npm_run_build.mustRunAfter gulp_html
    • processResources.dependsOn gulp_html

    do you know where I can find implementation documents about npx? Thank you!

  20. added a commit that references this issue on Mar 18, 2023
  21. ovflowd commented on Mar 22, 2023

    @ovflowd

    Hey there 👋 Node.js team here.

    This behaviour was introduced with nodejs/build#3223 so that y'all can track why this is happening now. Note that is expected behaviour. And that this #292 (comment) comment above is a proper fix for the issue.

    Extra details are also available here nodejs/nodejs.org#5149 (comment)

  22. shilan commented on Apr 20, 2023

    @shilan

    Adding the ,plugin I still get the same error. Could it be because I am using node version 10 and that is not supported anymore?

  23. deepy commented on Apr 20, 2023

    @deepy

    You need Gradle 4.5 or newer, if you cannot upgrade from Gradle 4 I recommend you upgrade to the latest Gradle 4.10.3

  24. Houinside commented on Apr 29, 2023

    @Houinside

    Hi guys, change distBaseUrl like this:

    node {
      ...
      distBaseUrl = 'https://direct.nodejs.org/dist/'
      ...
    }

    ref from nodejs/nodejs.org#5149 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions