How to fix packaging errors?

When I try to package my project it gives me errors and say that packaging has failed. Also, I’ve re-installed Visual Studios.

UATHelper: Packaging (Windows): Visual Studio 2019 is installed, but is missing the C++ toolchain. Please verify that the “MSVC v142 - VS 2019 C++ x64/x86 build tools (Latest)” component is selected in the Visual Studio 2019 installation options.
UATHelper: Packaging (Windows): Visual Studio 2019 x64 must be installed in order to build this target.
UATHelper: Packaging (Windows): Took 0.5985128999999999s to run dotnet.exe, ExitCode=6
UATHelper: Packaging (Windows): UnrealBuildTool failed. See log for more details. (C:\Users\bpmer\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_5.1\UBT-Horror_Game_1-Win64-Development.txt)
UATHelper: Packaging (Windows): AutomationTool executed for 0h 0m 2s
UATHelper: Packaging (Windows): AutomationTool exiting with ExitCode=6 (6)
UATHelper: Packaging (Windows): BUILD FAILED
PackagingResults: Error: Unknown Error
LogAudioMixer: Warning: Decoder Error, stopping source [CompileFailed]