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

2.5k views Asked by At

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).

2

There are 2 answers

3
sutudu On

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.

2
wmax On

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