I really don’t know what problem is.
What I want is, when project builds, it works like input command ‘npm install’.
This error occured at build.
Please Help me.
This is the error message.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':web:npmInstall'.
> A problem occurred starting process 'command 'npm''
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
6 actionable tasks: 6 executed
5:37:28: Task execution finished 'build'.
And this is the build.gradle.kt file.
plugins {
id("com.moowork.node") version "1.3.1"
id("com.github.node-gradle.node") version "2.2.3"
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.1.0")
developmentOnly("org.springframework.boot:spring-boot-devtools")
implementation(project(":domain"))
implementation(project(":common"))
}
tasks.getByName("bootJar"){
enabled = false
}
tasks.getByName("jar"){
enabled = true
}
buildscript {
repositories {
maven {
url = uri("https://plugins.gradle.org/m2/")
}
gradlePluginPortal()
}
dependencies {
classpath("com.moowork.gradle:gradle-node-plugin:1.3.1")
classpath("com.github.node-gradle:gradle-node-plugin:2.2.3")
}
}
apply(plugin = "com.moowork.node")
apply(plugin = "com.github.node-gradle.node")
configure<com.moowork.gradle.node.NodeExtension> {
version = "21.1.0"
npmVersion = "10.2.0"
isDownload = true
workDir = file("C:/Program Files/nodejs")
npmWorkDir = file("C:/Program Files/nodejs")
nodeModulesDir = project.file("${projectDir}/src/main/resources/static")
}
val npmInstall by tasks.getting(com.moowork.gradle.node.npm.NpmTask::class) {
dependsOn.clear()
doLast {
exec {
commandLine("npm", "install")
}
}
}
val copyFrontLib by tasks.registering(Copy::class) {
from("${projectDir}/src/main/resources/static")
into("${projectDir}/build/resources/main/static/.")
dependsOn(npmInstall)
}
tasks.getByName("compileJava").dependsOn(copyFrontLib)
I can’t apprehend what problem is.
So I coudn’t anythig for this problem.
Please Help me.
New contributor
이준민 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.