srs / gradle-node-plugin

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

Build fails with Gradle 7 #377

Open sergey-morenets opened 3 years ago

sergey-morenets commented 3 years ago

Hi

I'm using the latest version of this plugin:

plugins { id "com.moowork.node" version "1.3.1" }

After I've upgraded from Gradle 6.8.3 to Gradle 7 my project fails to build due to the error:


A problem was found with the configuration of task ':my-project:yarnSetup' (type 'YarnSetupTask').
  - Type 'YarnSetupTask' property 'args' is missing an input or output annotation.

    Reason: A property without annotation isn't considered during up-to-date checking.

    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.

    Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#missing_annotation for more details about this problem.

How can I fix it?

deepy commented 3 years ago

It's kinda amazing that you were able to use it on Gradle 6 as the latest version supported is Gradle 5, you can see https://github.com/srs/gradle-node-plugin/issues/315 for the background, but the short of it is that this plugin is no longer maintained, there's however a fork available at https://github.com/node-gradle/gradle-node-plugin which is supported (and supports Gradle 6+ and configuration cache as well)

sergey-morenets commented 3 years ago

Hi @deepy

Thank you for your efforts. I've already migrated to new plugin.

deanhiller commented 2 years ago

@sergey-morenets what plugin did you migrate too? more users may mean it will last longer.

sergey-morenets commented 2 years ago

@sergey-morenets what plugin did you migrate too? more users may mean it will last longer.

I've migrated to this one per @deepy advice: https://github.com/node-gradle/gradle-node-plugin

vifeng commented 2 years ago

In the node{} configuration I deleted the line npm and it worked for me. // Version of npm to use. npmVersion = '8.1.3'

for info, my node version = '17.1.0' I had been configuring according to https://github.com/srs/gradle-node-plugin/blob/master/docs/node.md remaining at your disposal