NuGet "error NU1102: Unable to find package with version" in CI
Unlike NU1101, the package id was found, but no published version matches the requested range. NU1102 lists the nearest versions the feed actually has so you can see the gap.
What this error means
dotnet restore fails with "error NU1102: Unable to find package X with version (>= 9.9.9). Found N version(s) in nuget.org [Nearest version: ...]".
dotnet
error NU1102: Unable to find package Newtonsoft.Json with version (>= 99.0.0)
- Found 100 version(s) in nuget.org [ Nearest version: 13.0.3 ]Common causes
A version pin that does not exist
The Version in the PackageReference is higher (or lower) than anything published, so no candidate satisfies the constraint.
A private prerelease only on another feed
The version exists as a prerelease or on an internal feed that the restore source list does not include.
How to fix it
Pin to a version the feed lists
- Read the "Nearest version" hint NU1102 prints.
- Set the
PackageReferenceto a version that is actually published. - Re-run
dotnet restoreto confirm it resolves.
Project.csproj
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />Allow prereleases when the target is a preview
If you truly need a preview build, request it explicitly and ensure its feed is configured.
Project.csproj
<PackageReference Include="Contoso.Lib" Version="2.0.0-preview.3" />How to prevent it
- Pin only to versions you have confirmed are published.
- Use a committed lockfile so versions are validated before CI.
- Configure prerelease feeds explicitly rather than guessing versions.
Related guides
NuGet "error NU1101: Unable to find package" in CIFix "error NU1101: Unable to find package X. No packages exist with this id in source(s)" during dotnet resto…
NuGet "error NU1605: Detected package downgrade" in CIFix "error NU1605: Detected package downgrade: X from A to B" during dotnet restore in CI - a transitive depe…
NuGet "error NU1202: Package is not compatible with framework" in CIFix "error NU1202: Package X is not compatible with net8.0" during dotnet restore in CI - the package support…