araqnid / set-aws-sso-credentials

Other
1 stars 0 forks source link

`./gradlew build` fails until `kotlinNpmInstall` run manually #174

Open arkangelofkaos opened 12 months ago

arkangelofkaos commented 12 months ago

Reproduction:

  1. Clone repo (MacBook Pro, Apple M2 Max, Ventura 13.6)
  2. Run ./gradlew build
  3. Fails

Error message:

> Task :packageNodeJsDistributableWithNCC FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':packageNodeJsDistributableWithNCC' (type 'NodeTask').
  - In plugin 'com.github.node-gradle.node' type 'com.github.gradle.node.task.NodeTask' property '$1' specifies directory '/Users/code/set-aws-sso-credentials/build/js/node_modules' which doesn't exist.

    Reason: An input file was expected to be present but it doesn't exist.

    Possible solutions:
      1. Make sure the directory exists before the task is called.
      2. Make sure that the task which produces the directory is declared as an input.

    For more information, please refer to https://docs.gradle.org/8.2.1/userguide/validation_problems.html#input_file_does_not_exist in the Gradle documentation.

More system information:

# java --version
openjdk 21 2023-09-19
OpenJDK Runtime Environment Zulu21.28+85-CA (build 21+35)
OpenJDK 64-Bit Server VM Zulu21.28+85-CA (build 21+35, mixed mode, sharing)

Manual Fix: Used IntelliJ to run the nodejs / kotlinNpmInstall gradle task. That created the missing build/js/node_modules directory. ./gradlew build succeeded after that

araqnid commented 12 months ago

That's odd. I can't reproduce it, and running build from scratch is basically what CI does too. Also the package task does explicitly depend on the kotlinNpmInstall task: https://github.com/araqnid/gradle-kotlin-nodejs-application/blob/296f9a4076071970c19a1a4edaf3efe307c3d3ae/src/main/kotlin/org/araqnid/gradle/kotlin/nodejsapplication/NodeJsApplicationPlugin.kt#L30

araqnid commented 8 months ago

Looks like it needs a new version of https://github.com/araqnid/gradle-kotlin-nodejs-application publishing as that change is unpublished