node-gradle / gradle-node-plugin

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

Unlink problem for downloaded node #273

Closed ebcFlagman closed 1 year ago

ebcFlagman commented 1 year ago

I've a problem when I will use the downloaded node for compiling my react app. I got the following error EPERM: operation not permitted, unlink '\\?\D:\IdeaProjects\maloneydownloader\frontend\build\node\node-v18.16.0-win-x64\node.exe'

My gradle file looks like:

plugins {
  id 'com.github.node-gradle.node' version '4.0.0'
  id 'base'
}

node {
  version = '18.16.0'
  download = true
  workDir = file("${project.buildDir}/node")
}

tasks.register('buildWebapp', NpxTask) {
  dependsOn npmInstall
  command = "react-scripts"
  args = ["build"]
}

assemble.dependsOn(buildWebapp)

When I use my local installed node I haven't this issue.

Any ideas about this?

ebcFlagman commented 1 year ago

It seems that the react-scripts build has also the buildDir outpur directory. When I change the workDir to e.g. workDir = file("${project.projectDir}/node") then it worked