Nuget

Nuget es la plataforma para la administración de paquetes en el SDK de .NET y se usa para la instalación de la CLI de Devprime.

Un error común al intentar instalar la CLI de Devprime es no tener la configuración nuget pública predeterminada en la lista de orígenes. Antes de continuar, confirme que tiene la versión más actualizada del SDK de .NET (Windows, Linux, Mac).
dotnet --version

error NU1101: Unable to find package Devprime.cli. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder, Microsoft Visual Studio Offline Packages
Tool 'Devprime.cli' failed to update due to the following:
The tool package could not be restored.
Tool 'Devprime.cli' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
  1. Forzar la instalación mostrando el nuget
    dotnet tool update -g --add-source 'https://api.nuget.org/v3/index.json' --ignore-failed-sources Devprime.cli

  2. Borrar la caché local de nuget
    dotnet nuget locals all --clear

  3. Compruebe y corrija los orígenes en el Nuget local.
    dotnet nuget list source

El resultado debería ser similar al ejemplo siguiente, estableciendo el origen de Nuget como “Habilitado”.

Registered Sources:
  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json
  2.  Microsoft Visual Studio Offline Packages [Enabled]
      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

Para eliminar una fuente, basta con introducir su nombre
dotnet nuget remove source nuget.org

Para agregar el origen nuget público
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org

NOTA: La existencia de direcciones URL privadas defectuosas puede dar lugar a errores al usar el servicio nuget.

Para obtener más información:

Última modificación November 12, 2023 (8e3b4c7e)