Nuget: The remote server returned an error: (504) Gateway Timeout

02:22

Reason Of Error

1) If I use the NPM UI I get

The remote server returned an error: (504) Gateway Timeout.

2) If I use the PM Console with Install-Package Ninject.MVC5 I get :

The source at nuget.org [https://www.nuget.org/api/v2/] is unreachable. Falling back to NuGet Local Cache at {userfolder}\AppData\Local\NuGet\Cache
Install-Package : Unable to find package 'Ninject.MVC5'.

3) If I type: Install-Package Ninject.MVC5 -source nuget.org i get the same UI error :

Install-Package : The remote server returned an error: (504)
Gateway Timeout.

Solution

In Visual Studio (2015): Tools / NuGet Package Manager / Package Manager Settings Change the Source value of nuget.org from https://www.nuget.org/api/v2/ to http://www.nuget.org/api/v2/ If you're using the CLI, you can do the same by using the nuget sources command.

Conclusion

This workaround obviously removes the encryption on your requests, so anyone sniffing will be able to see what packages you are downloading. Use at your own risk.

You Might Also Like

0 comments