Enhance npm cache clean error handling in Jenkinsfile
Wrapped npm cache clean command in a try-catch block to improve error handling. This ensures that the build process can proceed even if the npm cache clean step fails. Added an informational echo message for better diagnostics in case of failure.
This commit is contained in:
parent
98b86363f5
commit
2a56144bbc
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
|
|
@ -11,7 +11,11 @@ pipeline {
|
|||
def success = false
|
||||
|
||||
// Clean npm cache and try normal install and npm ci once
|
||||
sh 'npm cache clean --force'
|
||||
try {
|
||||
sh 'npm cache clean --force'
|
||||
} catch (Exception e0) {
|
||||
echo 'npm cache clean --force failed trying more things'
|
||||
}
|
||||
try {
|
||||
sh 'npm install'
|
||||
success = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user