srs / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
867 stars 210 forks source link

NodeJS cannot be resolved (Gradle 6) #351

Open dpeger opened 4 years ago

dpeger commented 4 years ago

With the upcoming Gradle 6.0 release it looks like resolving of the NodeJS artifact needs to be reworked. With the latest nightly (6.0-20191008230708+0000) I'm getting this error for the nodeSetup task:

Execution failed for task ':project:nodeSetup'.
> Could not resolve all files for configuration ':project:detachedConfiguration1'.
   > Could not find org.nodejs:node:10.15.3.
     Searched in the following locations:
       - https://nodejs.org/dist/v10.15.3/ivy.xml
     Required by:
         project :project
deepy commented 4 years ago

This is one of the reasons why we created the fork https://github.com/node-gradle/gradle-node-plugin/issues/2

dpeger commented 4 years ago

@deepy thanks for replying.

I saw that issue (https://github.com/srs/gradle-node-plugin/issues/299), but as it mentioned Gradle 5 I did not further look into the details. So it seems it's actually broken with Gradle 6...

I currently need the gulp plugin as well. So switching to node-gradle will not work out-of-the-box. But I can probably graft your fix!

deepy commented 4 years ago

The gulp plugin consists of an npm install gulp and a Node Task pointing to the node_modules/bin/gulp.js

Personally I think you'd be better off using the newly introduced NpxTask for gulp rather than GulpTask.

The fork is in active development so if it's incompatible with Gradle 6 we'll fix that

dpeger commented 4 years ago

Since I want to get rid of gulp anyway this might be a good reason to tackle this and use your fork afterwards...

huehnerlady commented 4 years ago

is there any update on this? We cannot upgrade to Gradle 6 because of this...

henrik242 commented 4 years ago

@huehnerlady Just switch to https://github.com/node-gradle/gradle-node-plugin

It's a drop-in replacement.

mishi-a commented 4 years ago

Is there a way to configure name of the zip to look for from distBaseUrl. I am currently giving distBaseUrl as my local filesystem it works but it looks node zip in specific format like win64-nodejs.zip is this search name configurable.

worldsayshi commented 3 years ago

For anyone else who ends up here and are like me. For Pete's sake, make sure to remove whitespace around your version tag!

ateebahmed commented 3 years ago

@worldsayshi

For anyone else who ends up here and are like me. For Pete's sake, make sure to remove whitespace around your version tag!

Please demonstrate? I'm using like this

node {
    version = 'v12.18.4'
}
deepy commented 3 years ago

I'm pretty sure we solved this a long time ago in the fork

ateebahmed commented 3 years ago

Well I couldn’t get it to work

Regards,

Ateeb Ahmed

On 12-Oct-2020, at 1:48 PM, Alex Nordlund notifications@github.com wrote:

 I'm pretty sure we solved this a long time ago in the fork

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

deepy commented 3 years ago

Well it's working flawlessly in our examples, so maybe you can create a small repository showing the issue and posting it in the fork's issues?

g-sudheer commented 3 years ago

Hi,

I'm also facing the same issue when I tried with gradle 6.6.1 and node plugin 1.3.1.

Is there any temporary solution or any new version coming up ?

Thanks, Sudheer.

worldsayshi commented 3 years ago

@ateebahmed My issue doesn't seem relevant for your issue. I loaded my version number from an external file. I don't have the code available right now, so this is pseudo code:

node {
    version = loadTextFromFile('.npmrc')
}

The issue was that my editor, Intellij, added a newline at the end of the .npmrc file whenever I saved it. I solved it by removing surrounding white space after loading the text from file.

MichaelRights commented 2 years ago

@worldsayshi

For anyone else who ends up here and are like me. For Pete's sake, make sure to remove whitespace around your version tag!

Please demonstrate? I'm using like this

node {
    version = 'v12.18.4'
}

remove v node { version = '12.18.4' }