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

NodeJS cannot be resolved (Gradle 6) #351

Open
dpeger opened this issue Oct 9, 2019 · 15 comments
Open

NodeJS cannot be resolved (Gradle 6) #351

dpeger opened this issue Oct 9, 2019 · 15 comments

Comments

@dpeger
Copy link

dpeger commented Oct 9, 2019

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
Copy link

deepy commented Oct 10, 2019

This is one of the reasons why we created the fork node-gradle/gradle-node-plugin#2

@dpeger
Copy link
Author

dpeger commented Oct 10, 2019

@deepy thanks for replying.

I saw that issue (#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
Copy link

deepy commented Oct 10, 2019

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
Copy link
Author

dpeger commented Oct 10, 2019

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

@huehnerlady
Copy link

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

@henrik242
Copy link

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

It's a drop-in replacement.

@mishi-a
Copy link

mishi-a commented Jan 18, 2020

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
Copy link

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
Copy link

ateebahmed commented Oct 12, 2020

@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
Copy link

deepy commented Oct 12, 2020

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

@ateebahmed
Copy link

ateebahmed commented Oct 12, 2020 via email

@deepy
Copy link

deepy commented Oct 12, 2020

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
Copy link

g-sudheer commented Nov 4, 2020

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
Copy link

@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
Copy link

@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' }

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

9 participants