Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nuget is not a recognized as an internal or external command

While running a batch file, I get the below error: nuget is not a recognized as an internal or external command It's not working from command prompt. Have a look at the below screenshot. readably sized image

like image 458
Varun Maggo Avatar asked Aug 10 '17 10:08

Varun Maggo


People also ask

How do you set the local path of NuGet EXE to your path environment variable?

Click “Advanced System Settings” then click the “Environment Variables” button located within the Advanced tab. From here double-click the PATH variable in the top panel and create a new entry by adding the path to the directory that contains your NuGet.exe file (in this instance it's C:/NuGet/).

How do I know if NuGet EXE is installed?

How do I check the exact version of the NuGet tools that are installed? In Visual Studio, use the Help > About Microsoft Visual Studio command and look at the version displayed next to NuGet Package Manager.

How do I force a NuGet package to install?

Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.


2 Answers

nuget is not a recognized as an internal or external command

That because NuGet is a external command, can not be recognized by Windows in an arbitrary directory, you should type the "NuGet" or "NuGet.exe" in the path where NuGet.exe exists and if you want type it in an arbitrary directory, you should download the NuGet.exe (Not VSIX) from NuGet.org and set the local path of NuGet.exe into your path environment variable.

like image 101
Joy Avatar answered Sep 20 '22 13:09

Joy


This happens when either you are not in the directory where the nuget.exe is located or your environment variables are not set for it.

  1. Make sure you have downloaded NuGet.exe.
  2. Navigate to it and right click, then click on properties.
  3. Copy the location of it.
  4. Navigate to Control Panel > System > Advanced System Settings > Environment Variables.

Windows 10

  1. Double click the variable Path click add new, paste in the location of the nuget.exe.

  2. Restart Command Prompt and the issue should be fixed.

Other operating Systems

  1. Double click the variable Path, If there is no other locations simply paste it in. If there is add a semi colon to the end of it and the paste it in.

  2. Restart Command Prompt and the issue should be fixed.

like image 36
Braden Brown Avatar answered Sep 20 '22 13:09

Braden Brown