Cataster
Cataster

Reputation: 3541

Why is Visual Studio required to install nuget?

I just installed chocolate behind proxy

$env:chocolateyProxyLocation = 'http://proxy.com:port'
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

and am trying to install nuget package manager

choco install nugetpackagemanager

Why does nuget require VS? I get this error:

 Chocolatey v0.10.13
Installing the following packages:
nugetpackagemanager
By installing you accept licenses for the packages.
Progress: Downloading NugetPackageManager 2.8.60318.667... 100%

NugetPackageManager v2.8.60318.667 [Approved]
nugetpackagemanager package files install completed. Performing other installation steps.
The package NugetPackageManager wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[N]o/[P]rint): y

ERROR: Visual Studio is not installed or the specified version is not present.
The install of nugetpackagemanager was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\NugetPackageManager\tools\chocolateyInstall.ps1'.
 See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - nugetpackagemanager (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\NugetPackageManager\tools\chocol
ateyInstall.ps1'.
 See log for details.

Upvotes: 1

Views: 522

Answers (1)

Gary Ewan Park
Gary Ewan Park

Reputation: 18981

Do you have a link to the actual application that you are trying to install? NuGet Package Manager is typically an application that was installed into Visual Studio (it later came baked into Visual Studio installation). As a result, to install this package:

https://chocolatey.org/packages/NugetPackageManager

You will need to have Visual Studio installed, as this tool is designed to work inside Visual Studio.

If you are actually trying to install the NuGet.exe, then you are using the wrong package, and you should instead be using this one:

https://chocolatey.org/packages/NuGet.CommandLine

or the NuGet Package Explorer here:

https://chocolatey.org/packages/NugetPackageExplorer

Update:

Regarding the comment:

The package provider requires 'PackageManagement' and 'Provider' tags.

In this context, PackageManagement is not referring to the NuGet Package Manager, but rather this:

https://www.powershellgallery.com/packages/PackageManagement/1.1.7.0

Which was previously known as OneGet.

Upvotes: 2

Related Questions