Jenkins idles in ec2 AWS instance

Hi everyone, I’m trying to run a pipeline in Jenkins in a AWS instance. When I run my pipeline it starts and while it is running it idles and nothing happens, it just goes forever with the build. I’m not sure what could be wrong so I don’t know what to include in my topic.
Has anything like this ever happened to any of you?
This is my Jenkinsfile content:

pipeline {
    agent any
    tools {
        nodejs '16.4.0'
    }
    stages {
        stage('Build') {
            steps {
                sh 'ls'
                catchError {
                    sh 'rm ./.env'
                    sh 'rm -R ./build'
                }
                sh 'npm install'
                catchError {
                    sh 'npx browserslist@latest --update-db'
                }
                sh 'npm install -g firebase-tools'
                sh 'npm run build'
            }
        }
    }
}

There is a small error present in this can you check and try it once other wise you need solution I will send it .

I’ve tried and it freezes when it downloads the dependencies just like stated in my description. What’s your solution?