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

Can't download any node distribution from nodejs.org (plugin v.0.13) #127

Open
czterystaczwarty opened this issue Jul 5, 2016 · 7 comments

Comments

@czterystaczwarty
Copy link

During build can not resolve any node.js distribution from https://nodejs.org/dist.

Execution failed for task ':war-admin:nodeSetup'.
> Could not resolve all dependencies for configuration 'detachedConfiguration1'.
   > Could not resolve org.nodejs:node:4.4.7.
     Required by:
         org.company.project:war-admin:1.63.0-rc1.1
      > Could not resolve org.nodejs:node:4.4.7.
         > Could not get resource 'https://nodejs.org/dist/v4.4.7/ivy.xml'.
            > Could not GET 'https://nodejs.org/dist/v4.4.7/ivy.xml'.
               > RSA premaster secret error

NOTE: It worked couple months and failed on new machine without node cached in gradle .
Reproduced by change node version.

plugin version: 0.13,
gradle version: 2.14

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }

    dependencies {
        classpath "com.moowork.gradle:gradle-node-plugin:0.13"
    }
}
/.../
apply plugin: 'com.moowork.node'

node {
    // Node.js LTS
    version = '4.4.7'
    distBaseUrl = 'https://nodejs.org/dist'
    download = true
}
@srs
Copy link
Owner

srs commented Jul 5, 2016

Hi.

Replicated your setup on a new machine (docker instance) and it does not fail. Are you sure https://nodejs.org/dist is reachable from your computer or if you have any "firewalls" blocking the request?

@srs
Copy link
Owner

srs commented Jul 5, 2016

I see that you get an RSA premaster secret error. Seems that somethings wrong with the certificates on your machine.

Just did a quick google search on it and this came up: https://developer.ibm.com/answers/questions/206325/how-to-fix-this-ssl-error-javaxnetsslsslkeyexcepti.html

@czterystaczwarty
Copy link
Author

When plugin try to resolve dist/v4.4.7/ivy.xml over http, server redirect to https 404 html page. Then IBM JVM 1.6 cannot handle credentials and download fail.

We tried to add a certificate nodejs.org a jvm. Without results.
For now we decided to use a global node on every machine by download = false.

@srs srs added node and removed node labels Dec 4, 2016
@lamba92
Copy link

lamba92 commented Jan 20, 2019

Same problem here.

Could not find org.nodejs:node:10.15.0.
Searched in the following locations:
  - https://nodejs.org/dist/v10.15.0/node.module
  - https://nodejs.org/dist/v10.15.0/ivy.xml

If you open https://nodejs.org/dist/v10.15.0/ you can actually see that there is no node.module or ivy.xml. I have no idea what is going on

SETUP (in Kotlin):

  • Gradle 4.10.0 and 5.0
  • OpenJDK 10.0.1 and OracleJDK 8.181
plugins {
    id("com.moowork.node") version "1.2.0"
}

node {
    download = true
    version = "10.15.0"
}

fun org.gradle.api.Project.node(block: NodeExtension.()->Unit) 
        = configure(block)

It is working on another project on same machine, at least until last Christmas.

@davthu
Copy link

davthu commented Feb 7, 2019

It seems like the distbaseUrl is not setup correctly because it adds org.nodejs/ to the path.

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

Results in Error:

> Could not resolve all dependencies for configuration 'detachedConfiguration1'.
   > Could not find org.nodejs:node:10.15.0.
     Searched in the following locations:
         https://nodejs.org/dist/org.nodejs/node/10.15.0/ivys/ivy-10.15.0.xml
         https://nodejs.org/dist/org.nodejs/node/10.15.0/tar.gzs/node-tar.gz-linux-x64-10.15.0.tar.gz
         https://nodejs.org/dist/org.nodejs/node/10.15.0/tar.gzs/ivy-10.15.0.xml

@dhakehurst
Copy link

I have started getting this issue,
works fine on one ( older) project,
new project just created will not download!!

any progress on tracking the issue?

@dhakehurst
Copy link

There seems to be no problem on a single project, but for me a sub project in a multi-project build always fails to download,

For anyone else landing here, I solved this by simple not using the mooworks node plugin anymore.

My build uses the kotlin plugin anyhow, which as for version 1.3.41 is able to download a nodejs/yarn/etc.

I just use that instead,
e.g.
parent project must apply the kotlin plugin (js or multiplatform)

in the sub project,

import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnSimple

...

tasks.create<DefaultTask>("yarn_install") {
    doLast {
        // ensure that node is downloaded by kotlin plugin (by default into ~/.gradle/nodejs)
        val nodeJs = NodeJsPlugin.apply(project.rootProject)
        YarnSimple.yarnExec(project, file("${ngDir}"), "yarn_install", "install", "--cwd", "--no-bin-links")
    }
}

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