Unable to install NuGet package 'sitecore.devex.extensibility.Indexing'. Ensure package names and versions are valid and that NuGet is installed.

There are two parts to working with a Sitecore CLI plugin:

1) Setup the plugin in the local file system

2) Interact with a Sitecore instance using the plugin setup

The sequence diagram below covers part 1 only!

Now over to the actual scenario:

I was trying to play with the Sitecore CLI 4.0.0 in a new Virtual Machine,  I did follow all the process involved to setup the plugin as depicted here below:;


But, finally while I tried to install the 4.0.0 Indexing plugin, I received this error:


Unable to install NuGet package 'sitecore.devex.extensibility.Indexing'. Ensure package names and versions are valid and that NuGet is installed.
 Sources:https://api.nuget.org/v3/index.json
file:///C:/Program Files (x86)/Microsoft SDKs/NuGetPackages/

I searched over the web for a solution. Although I removed the package name and searched, I couldn't get any favourable results. So, I decided to check if nuget is recognized in the machine and this is the error I received:

nuget not recognized:

nuget : The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:1

+ nuget

+ ~~~~~

    + CategoryInfo          : ObjectNotFound: (nuget:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

I then installed nuget through commandline using this command: 

Install-Package Nuget.commandline


I then ensured that the nuget install path is part of environment variables:

This time, When I typed nuget in the command line, it was recognized indeed:


But, when I executed the plugin install command, it still failed with the original error: 

Unable to install NuGet package 'sitecore.devex.extensibility.Indexing'. Ensure package names and versions are valid and that NuGet is installed.
 Sources:https://api.nuget.org/v3/index.json
file:///C:/Program Files (x86)/Microsoft SDKs/NuGetPackages/

Luckily, I had a development machine where the plugin installed fine. As I compared with that machine and based on the error, it stroked me to compare the nuget source in Visual Studio. That was the only place my new machine didn't have the myget Sitecore nuget url. So, I added the same:

Then, came back to PowerShell and executed the  dotnet sitecore plugin add -n sitecore.devex.extensibility.Indexing
The install was successful this time:



This solution is more of a hack but this should keep me going until I find where the package source in Visual Studio is picked from and how to update the actual source without using Visual Studio!


Comments

Popular Posts