Skip to content

/errors/nuget/nu1102-unable-to-find-package-with-version

error NU1102: Unable to find package X with version (>= Y)

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated
tool
NuGet
exit code
1
versions
.NET 6 – 10 SDK, NuGet 6.x – 7.x
os
any

error NU1102: Unable to find package X with version (>= Y) means the package id exists on the configured sources, but none of them has a version that satisfies the range. A plain Version="13.0.3" in a PackageReference is the range >= 13.0.3, so NuGet wants that version or a newer one. The log then lists, per source, how many versions it found and the nearest one. Set a version that exists, or add the feed that publishes it.

Reproduce it

bash
cat > nuget.config <<'EOF'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>
EOF
cat > App.csproj <<'EOF'
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="99.0.0" />
  </ItemGroup>
</Project>
EOF
dotnet restore 2>&1 | grep -oE "error NU1102: Unable to find package [^[]*" | sed 's/ *$//' | sort -u
exit "${PIPESTATUS[0]}"

Output · exit 1

error NU1102: Unable to find package Newtonsoft.Json with version (>= 99.0.0)

The full message continues with lines such as - Found N version(s) in nuget.org [ Nearest version: ... ]. The nearest version is the one to try first.

Fix

bash
dotnet list package                        # what the project references now
dotnet add package Newtonsoft.Json         # latest stable version
dotnet add package Newtonsoft.Json --version 13.0.3
dotnet add package Some.Package --prerelease

NU1101 or NU1102?

CodeMeaningLook at
NU1101No source has a package with this idThe id and the configured sources
NU1102The id exists, but no version matches the rangeThe version, prerelease suffix and feed
NU1103Only prerelease versions match a stable rangeUse a prerelease version explicitly
NU1603Warning: the exact lower bound was not found, a higher version was usedPin a version that exists

Sources