This message was deleted.
# community-support
s
This message was deleted.
🧵 3
v
Please do not split topics across several threads. This makes following the conversation in the threads view very hard as the context of the other messages is missing. If you have additional information either edit the original message or post to its thread. Regarding the problem, well the error tells you most likely that you use the
com.moowork.node
with a Gradle version it is not compatible with (i.e. 6+) and that you should replace it with the
com.github.node-gradle.node
plugin.
g
I updated it and ran but got below warning.
npm WARN notice [SECURITY] npm has the following vulnerabilities: 4 high, 1 moderate. Go here for more details: https://github.com/advisories?query=npm - Run
npm i npm@latest -g
to upgrade your npm version, and then
npm audit
to get more info.
c
yes, those are security warnings that you will need to decide how to action.
g
it is getting stuck
waited for 30mins
v
It is first of all no longer a Gradle topic. 🙂
Gradle calls npm, npm gives you a warning.
The warning tells you to use a newer npm version. The plugin you use uses some default npm version. If you want to use a newer npm version, configure your node plugin to use a newer npm version.
g
I am pasting my build file
plugins { //inlude the nodeJS plugin to execute nodejs and npm tasks //id "com.moowork.node" version "1.2.0" id("com.github.node-gradle.node") version "5.0.0" } node { download = true version = "9.11.1" npmVersion = "5.6.0" } //declare a build task task build //declare a task to create a zip of the app task zip(type: Zip) { from ('.') { include "*" include "bin/**" include "data/**" include "node_modules/**" include "public/**" include "routes/**" include "views/**" } destinationDir(file("dist")) baseName "trainSchedule" } //declare task dependencies build.dependsOn zip zip.dependsOn npm_build npm_build.dependsOn npm_test npm_test.dependsOn npmInstall npm_build.dependsOn npmInstall
v
Is there a Gradle question hidden somewhere?
t
Copy code
node {
    download = true
    version = "9.11.1"
https://github.com/nodejs/release#release-schedule End of life: 2018-06-30
Copy code
npmVersion = "5.6.0"
https://github.com/npm/cli/releases/tag/v5.6.0 Tagged Nov 28, 2017 That's not just "old" at that point… (I otherwise agree with Vampire it's no longer Gradle-related)
g
npm_build is getting failed while using build.gradle file. I am attaching the build.gradle file. Kindly help me to get npm build command.
plugins { //inlude the nodeJS plugin to execute nodejs and npm tasks id "com.moowork.node" version "1.2.0" } node { download = true version = "9.11.1" npmVersion = "5.6.0" } //declare a build task task build //declare a task to create a zip of the app task zip(type: Zip) { from ('.') { include "*" include "bin/**" include "data/**" include "node_modules/**" include "public/**" include "routes/**" include "views/**" } destinationDir(file("dist")) baseName "trainSchedule" } //declare task dependencies build.dependsOn zip zip.dependsOn npm_build npm_build.dependsOn npm_test npm_test.dependsOn npmInstall npm_build.dependsOn npmInstall
npm_test and npminstall is working fine
t
This is a Node issue (most likely something to do with the tools your Node build is using: webpack? whatever) You should ask on StackOverflow or a Node (or whatever is actually failing) community. But be prepared to be told to update your build first.
☝️ 1
g
moch is used
⁉️ 1
mocha
v
This is still not the least Gradle releated.
g
ok no problem
v
Or if it is, you miss to tell us how.
You did not even include any error message
g
npm run build command is getting executed when I run from command line
when I give ./gradlew build with the build.gradle file shared above
npm build is getting failed
is there any sample build.gradle file which contains npm build
v
You still did not share any error message
g
ok thanks let me try
-bash-4.2$ ./gradlew build Downloading https://services.gradle.org/distributions/gradle-7.4.2-bin.zip .............................................................................................................. Unzipping /var/lib/jenkins/.gradle/wrapper/dists/gradle-7.4.2-bin/48ivgl02cpt2ed3fh9dbalvx8/gradle-7.4.2-bin.zip to /var/lib/jenkins/.gradle/wrapper/dists/gradle-7.4.2-bin/48ivgl02cpt2ed3fh9dbalvx8 Set executable permissions for: /var/lib/jenkins/.gradle/wrapper/dists/gradle-7.4.2-bin/48ivgl02cpt2ed3fh9dbalvx8/gradle-7.4.2/bin/gradle Welcome to Gradle 7.4.2! Here are the highlights of this release: - Aggregated test and JaCoCo reports - Marking additional test source directories as tests in IntelliJ - Support for Adoptium JDKs in Java toolchains For more details see https://docs.gradle.org/7.4.2/release-notes.html Starting a Gradle Daemon (subsequent builds will be faster) <-------------> 0% INITIALIZING [2m 4s]
Evaluating settings
The above build is taking time
could you please let me know what can be done
v
Run with
--info
or
--debug
and / or
--scan
to get more information on what is happening
g
jenkins@ip-172-31-2-76:~/workspace/TrainAvailability_main$ ./gradlew npm_build --info Initialized native services in: /var/lib/jenkins/.gradle/native Initialized jansi services in: /var/lib/jenkins/.gradle/native Removing 0 daemon stop events from registry Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details Starting process 'Gradle build daemon'. Working directory: /var/lib/jenkins/.gradle/daemon/7.4.2 Command: /usr/lib/jvm/java-11-openjdk-amd64/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /var/lib/jenkins/.gradle/wrapper/dists/gradle-7.4.2-bin/48ivgl02cpt2ed3fh9dbalvx8/gradle-7.4.2/lib/gradle-launcher-7.4.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.4.2 Successfully started process 'Gradle build daemon' An attempt to start the daemon took 2.953 secs. The client will now receive all logging from the daemon (pid: 1646). The daemon log file: /var/lib/jenkins/.gradle/daemon/7.4.2/daemon-1646.out.log Starting build in new daemon [memory: 494.9 MiB] Using 1 worker leases. Watching the file system is configured to be enabled if available Now considering [/var/lib/jenkins/workspace/TrainAvailability_main] as hierarchies to watch File system watching is active Starting Build Settings evaluated using settings file '/var/lib/jenkins/workspace/TrainAvailability_main/settings.gradle'. Projects loaded. Root project using build file '/var/lib/jenkins/workspace/TrainAvailability_main/build.gradle'. Included projects: [root project 'cicd-pipeline-train-schedule-jenkins']
Configure project :
Evaluating root project 'cicd-pipeline-train-schedule-jenkins' using build file '/var/lib/jenkins/workspace/TrainAvailability_main/build.gradle'. Compiling build file '/var/lib/jenkins/workspace/TrainAvailability_main/build.gradle' using SubsetScriptTransformer. <-------------> 0% CONFIGURING [1m 39s]
root project > Compiling build file 'build.gradle'
v
If it needs long at that point, maybe your build agent is just too occupied, either CPU- or RAM-wise?
g
I am using Amazon Ec2 linux instance t2 micro. Could you please share me how much GB or CPU utilization required for standard execution of gradle build.
v
There is no "standard", heavily depends on the actual build
c
As much as it needs? You know your build - size the server accordingly. t2.micro instances are metered, if they run out of cpu credits they will peg at 100% cpu.
g
here If I run in the cloud shell it is executing perfectly. but when I try it through job it is getting stuck
Linux 5.10.184-175.731.amzn2.x86_64 (ip-172-31-40-58.ap-south-1.compute.internal) 07/05/2023 _x86_64_ (1 CPU) 013140 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 013140 PM all 68.45 0.00 7.48 0.93 0.00 0.14 11.35 0.00 0.00 11.66 013140 PM 0 68.45 0.00 7.48 0.93 0.00 0.14 11.35 0.00 0.00 11.66 [ec2-user@ip-172-31-40-58 ~]$
c
compare a build
--scan
from running it in the shell vs running it in Jenkins to identify configuration differences.