This usually happens when the default terminal profile in VS Code is set to null or restricted.
It is explained step-by-step in this short YouTube video here: https://youtu.be/Bh7w9vTVRko
Fix:
Open VS Code Settings (Ctrl + ,)
Search for terminal.integrated.defaultProfile.windows
Choose a terminal like Command Prompt or PowerShell
Restart VS Code
That should solve it!