Nuget is not recognized as an internal or external command

When I run a batch file, I get nuget is not a recognized as an internal or external command error: nuget is not a recognized as an internal or external command It does not work from the command line. Take a look at the screenshot below. readably sized image

+20
command-prompt nuget
source share
5 answers

nuget is not recognized as an internal or external command

That NuGet is an external command cannot be recognized by Windows in an arbitrary directory, you must enter " NuGet " or " NuGet.exe " in the path where NuGet.exe exists, and if you want to enter a type in an arbitrary directory you must download NuGet.exe (Not VSIX) from NuGet.org and set the local NuGet.exe path to the path environment variable.

+34
source share

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

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

Windows 10

  1. Double-click the Path variable, click add new, paste into the nuget.exe folder.

  2. Restart the command line and the problem should be fixed.

Other operating systems

  1. Double-click the Path variable, if there are no other places, just paste it. If there is, add a semicolon to the end and paste it.

  2. Restart the command line and the problem should be fixed.

+21
source share
  1. Download Nuget Exe, store it in the folder you want. For example: D: \ Software \ Nuget
  2. Open the Cmd prompt with the same path.
  3. To create this .nuspec file, run the following command at a command prompt.

    D: \ Software \ Nuget> Nuget.exe spec enter image description here

+4
source share

Instead of using nuget.exe in your path, use the .net version of dotnet nuget

0
source share

Try to run

  dep\nuget\nuget.exe 
0
source share

All Articles