'Nestjs: `yarn build` hangs forever on EC2 instance

I have cloned my nestjs project on EC2 instance and when I run yarn build or yarn start:dev, it just hangs there and does not make a build.

Please let me know what are the possible reasons for this.

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source