Microsoft C++ Build Tools includes the C++ compiler and other necessary tools. You can fix the error by installing these tools.
Download: Go to Microsoft C++ Build Tools.
Installation: Run the downloaded file and make sure to select the following components during installation:
Check the "Desktop development with C++" option.
Check "MSVC v142 - VS 2019 C++ x64/x86 build tools".
Check "Windows 10 SDK".