Last updated: Apr 4, 2024
Reading time·3 min
The error "'nuget' is not recognized as an internal or external command, operable program or batch file" occurs for two main reasons:
nuget
installed on your machine.nuget
in your system's PATH environment variable.'nuget' is not recognized as an internal or external command, operable program or batch file The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or operable program
To resolve the error on Windows:
nuget.exe
file.The nuget.exe
file isn't executable, so don't run it. Instead, open the
directory where you downloaded the file.
Right-click on the nuget.exe
file and click on "Properties".
nuget.exe
. Note that we
need the location of the directory where nuget.exe
is located, not the
location of the nuget.exe
file itself.Now you have to add the path you just copied to your PATH
environment
variable:
Click "OK" twice to confirm.
Close your Command prompt application and then reopen it.
You might also have to restart your PC, but that's not always necessary.
Open a new CMD shell and run the nuget
command to verify nuget
is installed
and configured properly.
nuget
You can resolve the "command not found: nuget" error by following the instructions in this section of the docs.
Install Mono for your operating system.
Run the following command in your terminal.
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
nuget
command by adding the following line to your
configuration file (e.g. ~/.bash_profile
, ~/.bash_aliases
or
~/.bashrc
).# Create an alias for `nuget` alias nuget="mono /usr/local/bin/nuget.exe"
nuget
command to verify nuget
is installed
and configured properly.nuget
If you get the "command not found: mono" error, you have to
install Mono for
your operating system as it is a prerequisite for nuget
.
You can learn more about the related topics by checking out the following tutorials: