John Singer
John Singer

Reputation: 51

how to install the dotnet driver for neo4j on windows 10 using powershell package manager

My goal is to install the neo4j dotnet driver so I can script it from Excel VBA. Hence I am using the windows powershell install package command as shown below.

PS:> Install-Package Neo4j.Driver-1.2.1

and I got the following error message:

Install-Package : No match was found for the specified search criteria and package name 'Neo4j.Driver-1.2.1'. Try
Get-PackageSource to see all available registered package sources.
At line:1 char:1
+ Install-Package Neo4j.Driver-1.2.1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
   ception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

I think my problem is that my powershell environment is not configured to find packages using nuget. This is all pretty new to me so any help is appreciated. Here is my current setup: PS C:\WINDOWS\system32> get-packagesource

Name ProviderName IsTrusted Location ---- ------------ --------- -------- nuget.org NuGet False https://api.nuget.org/v3/index.json PSGallery PowerShellGet False https://www.powershellgallery.com/api/v2/

PS C:\WINDOWS\system32> find-packageprovider

Name Version Source Summary ---- ------- ------ ------- nuget 2.8.5.208 https://onege... NuGet provider for the OneGet meta-package manager psl 1.0.0.210 https://onege... psl provider for the OneGet meta-package manager chocolatey 2.8.5.130 https://onege... ChocolateyPrototype provider for the OneGet meta-pa... DockerMsftProvider 1.0.0.1 PSGallery PowerShell module with commands for discovering, in... PowerShellGet 1.1.3.2 PSGallery PowerShell module with commands for discovering, in... ContainerImage 0.6.4.0 PSGallery This is a PackageManagement provider module which h... GistProvider 0.6 PSGallery Gist-as-a-Package - PackageManagement PowerShell P... GitHubProvider 0.5 PSGallery GitHub-as-a-Package - PackageManagement PowerShell ... NanoServerPackage 1.0.1.0 PSGallery A PackageManagement provider to Discover, Save and... ChocolateyGet 1.0.0.1 PSGallery An PowerShell OneGet provider that discovers packag... TSDProvider 0.2 PSGallery PowerShell PackageManager provider to search & inst... DockerMsftProviderInsider 1.0.0.2 PSGallery PowerShell module with commands for discovering, in... OfficeProvider 1.0.0.1 PSGallery OfficeProvider allows users to install Microsoft Of... GitLabProvider 1.3.4 PSGallery GitLab PackageManagement provider MyAlbum 0.1.2 PSGallery MyAlbum provider discovers the photos in your remot... WSAProvider 1.0.0.4 PSGallery Provider to Discover, Install and inventory windows... 0install 2.13.6 PSGallery Zero Install is a decentralized cross-platform soft... DockerProvider 0.0.0.3 PSGallery PowerShell module with commands for discovering, in... AppxGet 0.1.0.1 PSGallery Powershell Package Management (OneGet) Provider for...

When I do a find-package command I only see packages from the PSGallery source event though NuGet is listed as one of my package sources. Here is a partial output from find-package.

PS C:\WINDOWS\system32> find-package

Name Version Source Summary ---- ------- ------ ------- AzureRM.profile 3.4.0 PSGallery Microsoft Azure PowerShell - Profile credential Azure.Storage 3.4.0 PSGallery Microsoft Azure PowerShell - Storage service cm

Upvotes: 2

Views: 260

Answers (1)

David Makogon
David Makogon

Reputation: 71120

Try installing without version specified:

PM> Install-Package Neo4j.Driver

You'll get the latest version (currently 1.4.1).

EDIT - I did some digging. Looks like there's a .net version dependency, and v1.2.1 doesn't appear to work with .net 4.5.2. I just changed a local test project to 4.6.1, and now the v1.2.1 of the driver installs fine. So, I'd suggest checking your .net version (or simply stick with the latest Neo4j driver version).

Also: The way you're specifying the package, that doesn't look correct. Here's how to specify the version:

PM> Install-Package Neo4j.Driver -version 1.2.1

Upvotes: 1

Related Questions