gradle-node-plugin
gradle-node-plugin copied to clipboard
Cannot set the value of read-only property 'version' for task ':npmSetup' of type
- What went wrong: An exception occurred applying plugin request [id: 'com.github.node-gradle.node', version: '3.5.1']
Failed to apply plugin 'com.github.node-gradle.node'. Could not create task ':npmSetup'. > Cannot set the value of read-only property 'version' for task ':npmSetup' of type com.github.gradle.node.npm.task.NpmSetupTask.
`node { // Versions of node , npm version = "14.15.1" npmVersion = "6.14.8"
// Enabled the automatic download. False is the default (for now).
download = true
}`
The build is working fine with 2x versions (2.2.4) without any issues. But when I run the build with any of the 3x versions, I'm getting the above error.
The gradle version is 7.0 and JDK version is 8. I hope these are sufficient to run the 3x version as per the document.
@xavierdevairakkam can you provide a complete reproducer? are you using kotlin dsl? then i would expect
node {
version.set("16.14.0")
or the like
It is groovy dsl @cdietrich . Here is my sample build.gradle content for your reference
plugins {
id "com.github.node-gradle.node" version "3.5.1"
}
node {
// Versions of node , npm
version = "14.15.1"
npmVersion = "6.14.8"
// Enabled the automatic download. False is the default (for now).
download = true
}
npm_run_build {
inputs.file 'package.json'
}
task cleanDist(type: NpmTask) {
args = ['run', 'clean']
}
assemble.dependsOn npm_run_build
task test(type: NpmTask) {
dependsOn assemble
args = ['run', 'test']
}
task build(type: NpmTask) {
dependsOn clean
dependsOn cleanDist
dependsOn test
args = ['run', 'build']
}
wrapper {
gradleVersion = '7.0'
}
i still cannot reproduce your problem with that snippet.
Is it running fine for you? @cdietrich
i had to add a clean task and an assembe task, and a package json but yes