gradle-node-plugin icon indicating copy to clipboard operation
gradle-node-plugin copied to clipboard

[BUG FIX] Fix path resolution for executables

Open rasharab opened this issue 1 year ago • 5 comments

There’s an issue with mac silicion+intellij, whereby gradle process executor is not respecting path environment variables.

This gets around that by using a fix for the plugin whereby we attempt to resolve the path manually.

https://github.com/node-gradle/gradle-node-plugin/issues/152

https://youtrack.jetbrains.com/issue/IDEA-334183

We hit this constantly with our development team and this fix resolved it for us.

rasharab avatar Jan 16 '25 04:01 rasharab

I've got a hunch of what you're trying to solve, but if you can describe the problem I can give better pointers

Updated comments. I prematurely submitted this pr, apologies.

rasharab avatar Jan 16 '25 21:01 rasharab

Is this published yet? I have a similar issue when running under WSL2: I have nodejs installed both on windows and on WSL (Ubuntu). Despite having my PATH set to pick the WSL version, when I run gradle commands, it picks up the windows version of npm instead. The only thing that works is activating the npm install task, which I don't want since I already have a system-level nodejs installed. I'm using v7.1.0.

psoares avatar Mar 06 '25 15:03 psoares

I have this issue too. I'm using 7.1.0 and have Node.JS on my Mac (arm64), I'm sure that npm is usable, but the task always logs Cause: error=2, No such file or directory.

MukjepScarlet avatar Jul 15 '25 07:07 MukjepScarlet

I hope this can be merged and published, or at least provide a snapshot publication.

MukjepScarlet avatar Jul 15 '25 07:07 MukjepScarlet

I built it on jitpack.io Now we can use this in build.gradle.kts:

buildscript {
    repositories {
        maven(url = "https://jitpack.io")
    }
    dependencies {
        classpath("com.github.NextChapterSoftware.gradle-node-plugin:com.github.node-gradle.node.gradle.plugin:FixGradleNode-SNAPSHOT")
    }
}
apply(plugin = "com.github.node-gradle.node")

It actually works to me.

MukjepScarlet avatar Jul 15 '25 07:07 MukjepScarlet