/errors/nuget/nu1101-unable-to-find-package
error NU1101: Unable to find package X. No packages exist with this id in source(s): nuget.org
- tool
- NuGet
- exit code
- 1
- versions
- .NET 6 – 10 SDK, NuGet 6.x – 7.x
- os
- any
error NU1101: Unable to find package X. No packages exist with this id in source(s): nuget.org means NuGet asked every configured package source for the package id and none of them has it. The sources listed at the end are the ones that were searched. The id is usually misspelled, or the package is on a private feed that is not configured for this project. Fix the id, or add the feed to nuget.config.
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.Jsonn" Version="13.0.3" />
</ItemGroup>
</Project>
EOF
dotnet restore 2>&1 | grep -oE "error NU1101: [^[]*" | sed 's/ *$//' | sort -u
exit "${PIPESTATUS[0]}"Output · exit 1
error NU1101: Unable to find package Newtonsoft.Jsonn. No packages exist with this id in source(s): nuget.org
The id has an extra n. dotnet build and dotnet add package report the same error, since both restore first.
Fix
Correct the id (or add the source that hosts the package), then restore again:
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="13.0.3" />
</ItemGroup>
</Project>
EOF
dotnet restore -v q > /dev/null
echo "restore exit=$?"Output
restore exit=0
Private feeds
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="company" value="https://pkgs.example.com/nuget/v3/index.json" />
</packageSources>
</configuration>Keep credentials out of the committed file: use dotnet nuget update source company --username USER --password TOKEN --store-password-in-clear-text on build machines only, or the credential provider your feed documents.