In my case, the nestjs cli was missing in the vm so I ran docker pull nestjs/cli and it worked. Pull the nestjs cli image and try running docker compose up --build. If the issue still remains, put RUN install -g @nestjs/cli to your docker file. It must be running fine now.