Can't generate project files because "UE4 requires the NuGet Package Manager" when it is already installed

I’m getting this error when generating project files for VS2017 by running GenerateProjectFiles.bat from UE 4.20.2 source (Github release). I have NuGet installed and it’s still coming up with this error regardless:

UE4 requires the NuGet Package Manager
to be installed to use “C:\Program
Files (x86)\Microsoft Visual
Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe”.
Please run the Visual Studio Installer
and add it from the individual
components list (in the ‘Code Tools’
category).

I even tried uninstalling VS2017 completely, then reinstalling along with Build Tools and the required dependencies, in order to confirm it’s not an issue with NuGet on my local machine. This was all working fine with a 4.19 build.

Any ideas to resolve or bypass this error?

Error in cmd:

Already have NuGet installed:

I ended up simply commenting out the line in GenerateProjectFiles.bat where it returns an error if NuGet isn’t found. I believe this is a bug.

Found a solution to this. You have to actually install Nuget Package Manager on the separate MSBuild Tools Extension, not just within Visual Studio 2017. So even though it seems like I bug, it’s just not documented that well but is actually reporting accurately.

Here’s the steps to fix it:

  1. Open Visual Studio 2017.
  2. Go to Tools > Get Tools and Features… and wait for the Visual Studio Installer to pop up.
  3. It may default to "Modifying – Visual Studio 2017, just close out of this screen.
  4. You’ll be back on the main Visual Studio Installer screen, and if you have MSBuild Tools installed, you’ll see 2 products “Visual Studio Build Tools 2017” and "Visual Studio 2017.
  5. Click on the Modify button under Visual Studio Build Tools 2017 and go to “Individual Components”
  6. Under the Individual Components tab, you’ll see a subsection called “Code tools”, make sure both NuGet checkboxes are checked.
  7. Click the “Modify” button in the bottom right corner of this screen, and let it install.

Should be good after that.

Elemet808’s solution works. Thanks

Thanks a lot for this solution.

Thanks! ^^

Thanks !!!