node-gradle / gradle-node-plugin

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

nodeSetup: Couldn't follow symbolic link. #313

Open thSoft opened 1 month ago

thSoft commented 1 month ago

Hi,

Sometimes the nodeSetup task is failing with the error 'Couldn't follow symbolic link.' on osx.

Cleaning the .gradle directory fixes the issue.

> Task :myproject:nodeSetup FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':magicdraw-oslc-delegated-dialog:nodeSetup'.
> Couldn't follow symbolic link '/Users/thsoft/myproject/.gradle/nodejs/node-v20.11.1-darwin-x64/bin/npx'.

(This is exactly the same problem as https://github.com/srs/gradle-node-plugin/issues/190.)

Unfortunately I can't share my example and I can't reproduce this from a clean state, but I'll try to come up with a minimal example.

deepy commented 1 month ago

What version of the plugin are you using? And when it fails, what does /Users/thsoft/myproject/.gradle/nodejs/node-v20.11.1-darwin-x64/bin/npx point to?

thSoft commented 1 month ago

Thanks for reaching out!

Version:

plugins {
    id("com.github.node-gradle.node") version "7.0.2"
}

Symlink target:

/Users/thsoft/myproject/.gradle/nodejs/node-v20.11.1-darwin-x64/bin/npx -> /Users/thsoft/myproject/.gradle/nodejs/node-v20.11.1-darwin-x64/lib/node_modules/npm/bin/npx-cli.js