/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
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
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 --prereleaseNU1101 or NU1102?
| Code | Meaning | Look at |
|---|---|---|
| NU1101 | No source has a package with this id | The id and the configured sources |
| NU1102 | The id exists, but no version matches the range | The version, prerelease suffix and feed |
| NU1103 | Only prerelease versions match a stable range | Use a prerelease version explicitly |
| NU1603 | Warning: the exact lower bound was not found, a higher version was used | Pin a version that exists |
Sources
Related pages
errors · nugeterror NU1101: Unable to find package X. No packages exist with this id in source(s): nuget.orgNU1101 means no configured NuGet source has a package with that id: a typo, a private feed missing from nuget.config, or a disabled source. Fix the id or feed.codes · nugetNuGet error and warning codes: NU1101, NU1102, NU1301, NU1605, NU1608, NU1701, NU1903NuGet restore codes: NU1101 id not found, NU1102 version not found, NU1301 feed unreachable, NU1605 downgrade, NU1701 fallback, NU1901-NU1904 vulnerable.config · nugetnuget.config packageSources: add a private feed and clear the defaultspackageSources in nuget.config lists the feeds NuGet restores from. Use clear to drop inherited ones, add a private feed, check with dotnet nuget list source.