Could not get resource 'https://nodejs.org/dist/v14.19.3/ivy.xml'
Asked Answered
L

2

10

I am getting this Gradle error today (it worked fine before). Thank you in advance for your help.

Execution failed for task ':nodeSetup'.

Could not resolve all dependencies for configuration 'detachedConfiguration16'. Could not resolve org.nodejs:node:14.19.3. Required by: project : > Could not resolve org.nodejs:node:14.19.3. > Could not get resource 'https://nodejs.org/dist/v14.19.3/ivy.xml'. > Could not GET 'https://nodejs.org/dist/v14.19.3/ivy.xml'. Received status code 403 from server: Forbidden

Gradle version: 3.1

build.gradle configuration:

dependencies {
    classpath "com.github.node-gradle:gradle-node-plugin:2.2.4"
}

apply plugin: "com.github.node-gradle.node"

node {
    version = '14.19.3'
    download = true
}

We were using moowork as the build plugin and got the same error.

We also tried the latest gradle-node-plugin (3.5.1), and we got kotlin error (java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics).

Lurlene answered 20/3, 2023 at 22:36 Comment(3)
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.Gradey
We see the same issue with our builds. The gradle plugin tries to access the ivy.xml file and receives a 403 Forbidden. My assumption is that before this yielded a 404 and gradle then tried to download the artifact directly like: nodejs.org/dist/v14.18.2/node-v14.18.2-darwin-x64.tar.gzCollado
Mine also stopped working with the same error just two weeks ago. I was thinking might have something to do with an unsupported version node10 we are using?Marlite
M
9

Try this configuration in your build.gradle:

node {
  version = '14.19.3'
  distBaseUrl = 'https://direct.nodejs.org/dist/'
  download = true
}

Source: https://github.com/nodejs/nodejs.org/issues/5149#issuecomment-1470896878

Mordecai answered 7/4, 2023 at 12:2 Comment(2)
Does this mean they gonna come with a real solution rather than this hack?Marlite
I'd guess so, since they suspect a temporary caching problem on the cloudflare sideMordecai
L
2

Please remove --refresh-dependencies from gradle parameters. I had the same issue this morning and it worked for me. I assume they installed some sort of DDNS prevention software that is blocking multiple requests from the same IP.

Lechery answered 21/3, 2023 at 10:22 Comment(3)
where are those --refresh-dependencies?Marlite
I had this parameter in the invocation to gradle and I guess this was probably causing too many requests to the website, which ended up blocking me every time. If you don't use this parameter then I'm afraid my solution won't help youLechery
No, I am not but adding distBaseUrl like @Mordecai suggested, solves my issue.Marlite

© 2022 - 2024 — McMap. All rights reserved.