You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'.
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.
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
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
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.
Reacted by Roman Fuentes, davidr555, Sam, pkucia, Jameson Williams, Zhxingqiu and Marat
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).
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).
Reacted by Mikhail Bondar, Jan Cizmar, Jan Graßegger, Pavel Fiskovich, cdalexndr, Kwon Young Jae, Joseph Orlando, Robert McBride, Alex Nordlund, Donnie Reese and 19 more
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.
Activity
f3rdy commentedon May 15, 2018
Could you please give more info on
VBourdine commentedon May 25, 2018
I have the same issue. There you go my build.gradle:
I am trying to run just nodeSetup behind the proxy. The Output looks like:
immanuel-kirubaharan commentedon Aug 24, 2018
I'm also facing the same kind of issue, any solution/update on this would be great?
liamsteele commentedon Sep 18, 2018
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.
aollag09 commentedon Mar 19, 2019
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 targetdhakehurst commentedon Jul 9, 2019
any progress on this ?
liamsteele commentedon Jul 12, 2019
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.
judos commentedon Nov 22, 2019
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.3So 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.
daggerok commentedon Dec 5, 2019
are there some plans to fix it?
tdennler commentedon Dec 6, 2019
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).
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).
deepy commentedon Dec 7, 2019
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
daggerok commentedon Dec 7, 2019
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:
Regards,
Maksim
Used forked node plugin
Use forked node plugin
MrException commentedon Apr 6, 2020
Thank you @deepy for solution!
petrabrunner commentedon Apr 15, 2020
can confirm that @deepy's solution also worked for me. thx!
Thx @daggerok for testing and posting!
Yachin commentedon Apr 24, 2020
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.
deepy commentedon Apr 24, 2020
How reliant on gulp are you? Could you use gulp through
npxas a workaround?Yachin commentedon Apr 24, 2020
@deepy
The project used to run fine for my Windows machine. Till we added
do you know where I can find implementation documents about npx? Thank you!
Update build.gradle
ovflowd commentedon Mar 22, 2023
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)
shilan commentedon Apr 20, 2023
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?
deepy commentedon Apr 20, 2023
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
Houinside commentedon Apr 29, 2023
Hi guys, change
distBaseUrllike this:node { ... distBaseUrl = 'https://direct.nodejs.org/dist/' ... }ref from nodejs/nodejs.org#5149 (comment)